What would a developer do to update a picklist field on related Opportunity records when a modification to the associated Account record is detected?
Create a process with Process Builder
. … Create a method that creates valid Account records, and call this method from within test methods.
Which standard field mandatorily needs to be populated when a developer inserts new contact records programmatically?
Which standard field mandatorily needs to be populated when a developer inserts new Contact records programmatically?
LastName
is a mandatory field on the contact object, so it must be populated when a contact is inserted.
How should a developer retrieve a record by using an ID that is passed on the URL on a Visualforce page with a custom controller?
On a Visualforce page with a custom controller, how should a developer retrieve a record by using an ID parameter that is passed on the URL? B.
Use the $Action. View method in the Visualforce page
.
What is a good practice for a developer to follow when writing a trigger?
- One Trigger Per Object. We should write only 1 Trigger per Object. …
- Follow Naming Convention. …
- Use only Required Events in Trigger. …
- Context-specific Handler Methods. …
- Logic-less Triggers. …
- Bulkification. …
- Use Collections and Avoid SOQL or DML in FOR loops. …
- Use SOQL Query FOR Loop.
In which order does Salesforce execute events upon saving a record?
The parent record goes through the save procedure
. If the parent record is updated, and a grandparent record contains a roll-up summary field or is part of a cross-object workflow, performs calculations and updates the roll-up summary field in the grandparent record. Grandparent record goes through the save procedure.
What are the three ways for a developer to execute tests in a org ref choose 3 answers?
- Bulk API.
- Tooling API.
- Setup Menu.
- SalesforceDX.
- MetaData API.
How does a developer use schema builder to remove a custom field?
A.
Remove all the references In the code
and then the field will be removed from Schema Builder. B. Remove all references from the code and then delete the custom field from Schema Builder.
Why would a developer use test startTest () and test stopTest ()?
These methods, Test. startTest and Test. stopTest, are
used when testing governor limits
. Or in other words, executing test scenarios with a larger data set.
Which three types of information could be seen by a developer using the debug log?
- Database changes.
- HTTP callouts.
- Apex errors.
- Resources used by Apex.
- Automated workflow processes, such as: Workflow rules. Assignment rules. Approval processes. Validation rules. Note. The debug log does not include information from actions triggered by time-based workflows.
How can you lock record using SOQL so that it Cannot be modified by other user?
In Apex, you can use FOR
UPDATE
to lock sObject records while they're being updated in order to prevent race conditions and other thread safety problems. While an sObject record is locked, no other client or user is allowed to make updates either through code or the Salesforce user interface.
Why should trigger be less logic?
What do you mean by logic-less trigger? As you can see here, instead of
writing all the logic
(that is: all the things we want it to do, with all its lines and instructions) within the trigger, we make use of a “contact handler” class to call the methods we need in each case.
How would you approach to write a test class what are the best practices?
- Test class must start with @isTest annotation.
- Focus 90+ : To deploy to production at least 75% code coverage is required. …
- One Assert Statement per method : Always put assert statements for negative and positive tests.
What is difference between with sharing and without sharing in Salesforce?
With Sharing – Enforce the sharing rules that apply to current user. Without Sharing –
Doesn't enforce the sharing rules
. If a class is not declared as either with or without sharing, the current sharing rules remain in effect.
Can you explain the order of execution in triggers?
The order of execution isn't guaranteed when having multiple triggers
for the same object due to the same event. For example, if you have two before insert triggers for Case, and a new Case record is inserted that fires the two triggers, the order in which these triggers fire isn't guaranteed.
What is the difference between trigger new and trigger old?
When a field
value
is changed to certain value, we use trigger. … new to compare the older and new version values of the field values on a record and perform the required business logic accordingly. trigger. old is available only on the update and delete events.
What is the difference between custom setting and custom metadata?
Main difference between custom metadata and custom setting is that
custom metadata records are deployable and packagable
. But we can not deploy custom setting data. Custom settings enable you to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user.