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
YCar011673994022133027YCar011673994022133027 

Trigger to auto gen account number from closed-won opportunity

Hello All, I'm new to developing and was hoping I could get some assistance with this - or if it's even possible. I would like to auto generate an account number ONLY if it's opportunity is closed - won. Can this be done? Any help would be appreciated. Thx
Satish_SFDCSatish_SFDC
Is the Account Number a custom field on the Opportunity or does it refer to a field on the Account.
If it is a field on Opportunity then you can simply use the after update trigger on Opportunity and generate an account number.

regards,
Satish Kumar
YCar011673994022133027YCar011673994022133027
Thank you for your response. The account number is a field on the Account. I would like for the closed-won status of an Opportunity to trigger an auto generated number for the Account. Not sure if this is possible to create a trigger from one object tab to another. Thank you.