+ Start a Discussion
Mr. WMr. W 

Require a Product when Opportunity created

I want to enforce users to "add product" when they create a new opportunity.  




I am only displaying the "save & add product" button however the user can still decide to cancel while filling out the product and the opportunity still saves. I need to be able to not allow the user to create the Opp. without the Product information filled out.  


Any help with how I would accompish this would be great.  

Try using Validation rules. If that is not helping, write a small "before insert" trigger

Validation rule would not work here,You will have to go for a Before insert Trigger to achieve this.

Mr. WMr. W

Hi Vinit, 


I'm very new to triggers.  You think you could help me with the code and the test class?