You need to sign in to do that
Don't have an account?
Phuc Nguyen 18
Add label message in batch class
Hello Everone,
I ahve the below batch class and was wondering if ther eis a way to throw up a message to let the user know that the update is happening. Its a batch and some of the recvords have 100+ child records so it will take a awhile for the batch classes to complete.
Just don't want the user guessing what is going on.
Thanks you.
P
I ahve the below batch class and was wondering if ther eis a way to throw up a message to let the user know that the update is happening. Its a batch and some of the recvords have 100+ child records so it will take a awhile for the batch classes to complete.
public class UpdateNoticeFromAccountQueueableBatch implements Database.Batchable <sObject>, Database.Stateful{ public List<Notice__c> noticeList = new List<Notice__c>(); public String vatQueVatValue; public UpdateNoticeFromAccountQueueableBatch ( List<Notice__c> records ,String vatValueFromQue ) { noticeList = records; vatQueVatValue = vatValueFromQue; system.debug('noticeList value in batch' + noticeList ); system.debug('vatQueVatValue value in batch' + vatQueVatValue ); } public List<SObject> start(Database.BatchableContext bc){ return noticeList; } public void execute(Database.BatchableContext bc, List<Notice__c> scope){ List< notice> NoticeToUpdateFromAccount = new List<Notice__c>(); system.debug('scope value ' + scope); system.debug('vatQueVatValue value batch' + vatQueVatValue); if(!scope.isEmpty()){ For ( Notice__c noticess : scope){ noticess.Any_other_Lessor_Info_VAT_Number__c = vatQueVatValue; } Database.update(scope, false); ---- add label message here to notify user that batch is running? } }
Just don't want the user guessing what is going on.
Thanks you.
P
You can use following thread on how to send mail using finish method. https://developer.salesforce.com/forums/?id=9060G000000I1BdQAK
Hope this answers your query, if so please can you mark this as the best answerl. Thanks
Thanks