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
sumitasumita 

stop creation of opportunity if product is not added to it.

A 'Save and Add Product' button is added to the opportunity page layout. What i want to do is..

 

restrict the user from creating the and saving the opporunity if products are not added to it.

Suppose a user creates an opp and upon clicking, save and add product, the opp gets saved, and user is redirected to the add products page, but if the user then closes the window or clicks on another tab, the opp still gets created in the database, i want to stop the creation of this opportunity if no products are added to it.

 

 

please help me,

 

ur replies will be greatly appreciated. 

 

~Sumita

Ispita_NavatarIspita_Navatar

You are being redirected to the "Add Product" page after creation of Opportunity, so the only recourse you have is deleting the opportunity created in case the user does not add product to it.

Besides you cannot prevent creation of opportunity as Product has a reference to the Opportunity record- hence the most appropriate solution will be to delete the opportunity in case he she does not Add Product.

Alternatively one can have a single page(Visual Force page) for adding Opportunity and respective product and in case the user does not provide the information for add product then you can prevent creation of opportunity too.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.