function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Creation of auto contact and auto account



when i am creating account it should need to create a new contact,and when i am creating a new contact it should need to create a new account,when i m doing this it should going to infinte loop ,can any one please suggest me how to reslove this,can any one provide sample code it would be great helpfull.

Best Answer chosen by Admin (Salesforce Developers) 
Bhawani SharmaBhawani Sharma
Use some static flag from a class to prevent the recursive call.
Like Account trigger first Like should be:
if(HelperClass.EXECUTE_ACCOUNT_TRIGGER == true) {


Do the same for contact