Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2020-07-28 09:46 PM
We have the standard list of cross-references to another application on our layout. When someone goes into Edit mode and clicks one of the little X buttons to remove a cross-reference, we'd like to have Archer pop up a dialog saying "You are removing a cross-reference. Are you sure?" with OK/Cancel buttons, or something similar.
How can we achieve this with a custom object (or other method)?
2020-07-31 03:08 PM
Found a snippet of jquery that did what I wanted in a Custom Object:
<script type="text/javascript">
$(document).ready(function() {
$("a[class='GridRemoveImage']").each(function(){
// Cache event
var existing_event = this.onclick;
// Remove the event from the link
this.onclick = null;
// Add a check in for the class disabled
$(this).click(function(e){
var result = confirm("Are you sure?");
if (result == false) {
e.stopImmediatePropagation();
e.preventDefault();
}
});
// Reattach your original onclick, but now in the correct order
// if it was set in the first place
if(existing_event) $(this).click(existing_event);
});
});
</script>