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