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
Nick ValerioteNick Valeriote 

Sample code for modal pop-up when a record is saved?

Hi SF Community,

Does anyone have some simple sample code I can modify that will allow me to generate a pop-up box when a user saves a record (custom object = invoice__c)?

Thanks much!
Nick
Raj VakatiRaj Vakati
You need on Classic or lightining ?? 
http://sfdcmonkey.com/2017/04/15/modal-box-lightning-component-salesforce/

This is the code to show modal popup 
 
<!--###### MODAL BOX Start######--> 
            <section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open">
                <div class="slds-modal__container">
                    <!-- ###### MODAL BOX HEADER Start ######-->
                    <header class="slds-modal__header">
                        <lightning:buttonIcon iconName="utility:close"
                                              onclick="{! c.closeModel }"
                                              alternativeText="close"
                                              variant="bare-inverse"
                                              class="slds-modal__close"/>
                        <h2 id="modal-heading-01" class="slds-text-heading_medium slds-hyphenate">About Sfdcmonkey.com</h2>
                    </header>
                    <!--###### MODAL BOX BODY Part Start######-->
                    <div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
                        <p><b>The goal of this blog is to provide tips and tricks/workarounds for salesforce developer and admins.
                            Many of us face the same issues and have the same questions when using and implementing Salesforce.
                            As a community of users and developers, it is important for us to share our experiences.
                            I try to reach out to other users and help the Salesforce community in general.
                            Much of this blog will focus on Lightning(code &amp; config.) but I will also
                            cover some of the more basic topics in salesforce.
                            </b>
                        </p>
                    </div>
                    <!--###### MODAL BOX FOOTER Part Start ######-->
                    <footer class="slds-modal__footer">
                        <lightning:button variant="neutral" 
                                          label="Cancel"
                                          title="Cancel"
                                          onclick="{! c.closeModel }"/>
                        <lightning:button variant="brand" 
                                          label="Like and Close"
                                          title="Like and Close"
                                          onclick="{! c.likenClose }"/>
                    </footer>
                </div>
            </section>
            <div class="slds-backdrop slds-backdrop_open"></div>
            <!--###### MODAL BOX Part END Here ######-->

 
Nick ValerioteNick Valeriote
Thanks, Raj.
I need it for Classic.
Also, where do I specify when this modal box pops up?  I want it to appear when users click the Save button on our custom invoice object (invoice__c).
Sandhya TirunagariSandhya Tirunagari
I need this for lightning. I also have the same need to show popup on case details page after user clicks on Save button. First it should save the case details record and then immediately show the popup modal.