Monday 3 September 2018

Dynamically Determine Calling Context:

In some cases we need to Identify the calling context  whether its called from trigger,batch,future methods  etc..

These are the steps to determine it:

Batch - System.isBatch()
@future - System.isFuture()
Queueable - System.isQueueable()
Schedulable - System.isScheduled()
Trigger - Trigger.isExecuting

For example:
Consider  batch class Example:
if(System.IsBatch() == true){
    //Its calling from batch
}

More Information:

https://salesforce.stackexchange.com/questions/131140/dynamically-determine-calling-context

1 comment:

  1. A good sales manager should know what attributes to look for and be able to foster those attributes into a successful sales executive. One of the primary functions of the sales manager is to recruit sales personnel.

    Criminology Justice test bank solutions manual

    ReplyDelete