How To: Load the Super Clone Pro Clone or Copy Page with Child Records Unchecked
October 14, 2021
How To: Split Clone Into Multiple Steps by Chaining Pages
December 1, 2022

How To: Indicate When a Value Was Changed on a Super Clone Pro Clone Page

The Clone, Copy, and Edit page components can be embedded in a wrapper Visualforce page. This allows you to apply styles and use JavaScript to manipulate the page. This example shows how to change the background color of the table cell when an input value was changed.

Create a new Visualforce page. Replace the lcrm_scp:ScpClone if using the Copy or Edit pages.

<apex:page lightningStylesheets="true">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
	<style>
        .was-changed {
          background-color: yellow !important;
        }
    </style>
    
    <lcrm_scp:ScpClone />     
        
    <script type="text/javascript">
        jq$ = jQuery.noConflict();
        jq$(window).on('load', function() {
            jq$(":input").change(function() {
            	let ctd = jq$(this).closest('td');
                if (ctd) {
                    ctd.addClass('was-changed');
                } else {
                    console.log('table cell was not found');
                }
            })
        });
    </script>
</apex:page>

Finally, create or update a custom button to reference this new custom Visualforce page. Replace the name of the packaged page name “lcrm-scp__scpclone”, “lcrm-scp__scpcopy”, “lcrm-scp__scpcopy” with the new Visualforce page name. It should look something like this.

/apex/CloneIndicateChanged?rid={!YourObject.Id}&cfg=YourConfigName&lss=1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
Read more