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
dev2014dev2014 

Automate account creation by Apex trigger or worklow

Did anybody develop an Apex trigger or workflow on leads and Accounts or on Opportunity and Accounts so only when opportunity status was "closed/won" only then an Account will automatically be open in the Account Object. That way you can prevent data errors and create  data quality in which only customers are under the account object. Your feedback would be appreciated..

Thanks
Shashikant SharmaShashikant Sharma
You could develop a trigger on Opportunity After update to insert an account or change status of existing account on opportunity.

Alternatively you could use https://www.youtube.com/watch?v=APiJg7908jk as well for this.
dev2014dev2014
Thanks . I'm new to Apex. Can you direct me  to the  Apex Trigger  for creating a trigger on opportunity after update to insert an account  ? The business logic is When an opportunity stage is updated closed/won insert a new account with mapping opportunity company name to account name. Basically I want to map opportunity organization name ,amount and date fields and map those into the correct account fileds
The goal is to create new account only when it's a customer and prevent data quality mistake when an opportunity is entered as an account by mistake and not as opportunity and to ensure it's not missing from the opportunity reports, dashboard and forecasts.  I would appreciate the Apex trigger code reference or input..

Thanks,