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
mdelgadomdelgado 

Ability to create a new entity after closing an opportunity

Hello,

 

I've been asked to implement the following:

 

Create a new project (one of our custom objects) when an opportunity is marked "closed won".  I believe I can implement this using an apex trigger.

 

My question is the following:

 

I'd like to have the ability to not allow users to make changes to the opportunity once is marked "closed won" (or any of the other close states).  This would prevent a possible 2nd project (duplicate) from being created

 

Does anyone have any suggestions?

 

thanks,

 

Mirko

Shashikant SharmaShashikant Sharma

Yes you are correct you need a trigger for the initial requirement of creating new projecct record.

You can see these : http://forceschool.blogspot.com/search/label/Apex%20Triggers

 

if you want to take help in how to write triggers.

 

Your second question : How to prevent duplicate project creation. : For this either you can have validation rule on Opportunity so that once it has been closed/won you can not change it again. This validation can be done using trigger also.

 

let me know if any issues in it.