You need to sign in to do that
Don't have an account?
Visithra
Help to get this future method asynchronous apex
Create a future method to calculate total number of contacts under each account and update it in the account custom field names as number of contacts field, implement this using future method.
You can use the following code to achieve your requirement.
You can refer to the below link as it has the same question on the forum.
https://developer.salesforce.com/forums/?id=906F0000000D8hwIAC
Please mark it as Best Answer if the above information was helpful.
Thanks.
Hi Visithra,
Please refer to the below code :
To define a future method, simply annotate it with the future annotation, as follows.
Please mark it as best answer if it helps.
Thanks,