0% found this document useful (0 votes)
11 views

Apex Assignment-Webshala

The document contains examples of Apex programs and assignments. It includes programs to delete, restore, update, and deactivate records based on criteria. It also includes examples of using collections, SOQL queries, triggers, batch jobs, future methods, and scheduled jobs.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Apex Assignment-Webshala

The document contains examples of Apex programs and assignments. It includes programs to delete, restore, update, and deactivate records based on criteria. It also includes examples of using collections, SOQL queries, triggers, batch jobs, future methods, and scheduled jobs.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Apex programs

1) Write an apex program, to Delete the Records from the Hiring Manager
object whose name is starting with the specified Characters.

2) Write an apex program, to Re-Store the Hiring Manager Record back to the
object based on the Specified Name.
3) Write an apex program, to Update the Hiring Managers whose name starting
with "Apex HR" we below. Location = 'Pune' Contact Number = '9876543210'

4) Write an apex program, to DeActivate the User Based on the Specified


UserName.

5) Write an apex program, to Change the Priority as "High" for all New Case
Records. And Create a New Case Record into the object.

6) Define an Apex Class to manage the Customer Details and Assign the Values
and Print the Values.

7)Write an apex program, to fetch the Account Record based on the specified
name and fetch all the Related Contacts, Opportunities, and Cases associated
with the account.

8) Write an apex program, to fetch the Case Details based on the specified Case
Number and fetch all the associated Parent Details(Contact), Grand Parent
details(Account),..etc.

Collections:
1. Write an apex program, to insert 250 Lead Records inside the object.
2. Write an apex program, to insert 400 Contact Records inside the object.
3. Write an apex program, to insert an Account Record. And 10 Related
Opportunity Records in the object by using Bulkification Process.

4) Create a Map and insert record into opportunities object using map.
SOQL and SOSL Queries:

1)Fetch Name, max_no_of_appointments__c of all the clinics that are in


Florida.
2) display all contacts which are associated with accounts
3) display all accounts which have null contacts associated with them
4) display the second highest salary of an employee
5) display sum of all annual revenue of accounts
6) find test in accounts lead and opportunities
7) write sosl query to find name ‘Text Tiles’ in account, opportunity,
lead,contacts.

Trigger Assignments

1) On Account and Opportunity object there is city field and whenever i update
the account city field with new value then atomatically change assosiated
opportunity city field get updated

2) There is a description field on Account and also on Contact. Whenever the


account description is updated, the related Contact description should also be
updated but I should be able to identify from the description which account this
contact is related to.

3) Write a trigger on contact. Scenario :- Contact have two fields 1) Name 2)


Gender (Male/Female) Whenever Gender is male, prefix Name with ‘Mr’ and
When Gender is female, prefix Name with ‘Mrs’

4) Write a trigger to check duplicate email on employee object

5) Create the Triggers for following scenarios:


i) Upon Creating Hiring Manager:
Copy the Record into the Recruiter Object.

ii) Once the Hiring Manager Record has been Updated:


Sync the Changes into the Associated Child Record.

iii) Once the Recruiter Record has been Updated:


Sync the Changes to the Associated Hiring Manager Record.
6) Create a Trigger to Auto-Convert the Lead Records as the Customers upon
Changing the Lead Status as "Closed - Converted".

7) Create a Trigger on Lead Object, to Auto Populate the Annual Revenue based
on the Industry Name as below.
Industry Name AnnualRevenue
----------------------------------------
Banking 90,00,000
Finance 76,00,000
Insurance 45,00,000
Manufacturing 84,00,000
Education 74,00,000
Consulting 32,00,000
Energy 94,00,000

Day 6-Asynchronous Apex


1) Create a Batch Job to Synchronize the Account Record's Billing Address
information into the associated Contact Record's Mailing Address by dividing
the Account Records to the various batches of size "4".

2) Create a Batch Class, to Calculate the Total Annual Revenue of all the
Account Records in the object, by dividing them to the various batches of size
4.

3) Create a Future Method, to Insert a Hiring Manager Record and to De-


Activate a User Record.

4) Create a Schedule Job, To Purge All the Position Records, whose MileStone
Date is Over. Schedule the Job to be get run on EveryDay morning @ 2.00 AM.

You might also like