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
rmranjith8881.3927046400771116E12rmranjith8881.3927046400771116E12 

How to give alert as a popup message on the save, when Opportunity stage becomes posted?

Hi EveryOne,

I have 2 Queries,
1.) Can we have an alert message on the save for Opportunity record, whenever Stage becomes Posted?

2.) Can we have a Email section, open Activities, closed activities, Tasks and Events as a separate sections(like related lists)?

Thanks in Advance.
MithunPMithunP
Hi Ranjith,

For 1: You can achieve this by creating a VF page with standard controller as "Opportunity" and write javacript code for showing alert message. And include this page in your opportunity page layout as a hidden page.

For 2: It's not possible with standard layout, If you really want then you can create a VF for complete page functionality.

Best Regards,
Mithun.
rmranjith8881.3927046400771116E12rmranjith8881.3927046400771116E12
Hi Mithun,

Thanks for reply,

1.) Can you please share some sample code here, how to achieve by javascript ?

2.) Can you please share some sample VFP code here?

Thanks
Ranjith.
Shiju Thomas.Shiju Thomas.

Hello Ranjith,

Not sure if the answer is too late to post.

However, you can also do it on the standard page layout too.

Steps:
- Step-1: Create a custom field checkbox preferrably and set the value to false
- Step-2: Use trigger (before save) on the opportunity object to set the value of the custom field to true.
- Step-3: Create a VF page and using Javascript/JQuery, on the load action of the page,check if the value is true and if yes, show the desired alert.  The next line after the alert should be to set the value of the custom field to false (in case you only want to show the message only once after the save is called) 
- Step-4: Render the VF page onto the standard page layout and keep it hidden. You can do this by unchecking the properties "Detail Page" and "Edit Page" checkboxes. I also chose the layout to be 1-Column. In this way, the page would be hidden on the standard layout.

Hope this helps!!!

Regards,
Shiju.