SalesForce Interview questions


Total available count: 39
Subject - SalesForce
Subsubject - SalesForce

What are context variables in triggers?

Below are the context variable available in triggers,

  1. is executing:- Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an execute anonymous() API call.
  2. isInsert:- Returns true if this trigger was fired due to an insert operation, from the Salesforce user interface, Apex, or the API.
  3. isUpdate:- Returns true if this trigger was fired due to an update operation, from the Salesforce user interface, Apex, or the API.
  4. delete:- Returns true if this trigger was fired due to a delete operation, from the Salesforce user interface, Apex, or the API.
  5. isBefore:- Returns true if this trigger was fired before any record was saved.
  6. isAfter:- Returns true if this trigger was fired after all records were saved.
  7. isUndelete:- Returns true if this trigger was fired after a record is recovered from the Recycle Bin (that is after an undelete operation from the Salesforce user interface, Apex, or the API.)
  8. new:- Returns a list of the new versions of the sObject records. This sObject list is only available in insert, update, and undelete triggers, and the records can only be modified in before triggers.
  9. Newman:- A map of IDs to the new versions of the sObject records. This map is only available in before update, after insert, after the update, and after undelete triggers.
  10. old:- Returns a list of the old versions of the sObject records. This sObject list is only available in update and deletes triggers.
  11. old map:- A map of IDs to the old versions of the sObject records. This map is only available in update and deletes triggers.
  12. size:- The total number of records in a trigger invocation, both old and new.



Next 5 interview question(s)

1
What are different type of Triggers?
2
What are the different type of events on which a trigger can fire?
3
What is a Trigger?
4
What are Governor Limits?
5
What is OWD?