cancel
Showing results for 
Search instead for 
Did you mean: 
No ratings
JoyVanBuskirk
Contributor III

I've recently been working on a project to integrate Archer with an Artificial Intelligence tool which will do some natural language processing on our Risks. As part of that I needed to be able to have Risks sent to the AI every time someone clicked Save on a change to the risk in the UI. @Ilya Khen had posted some code that showed how to clone the Save buttons and assign a new function to them which could include your own code and eventually the normal save or apply functionality. I struggled to make that work in 6.9 because of some changes RSA had made to the design of the Save and Apply buttons since Ilya had written the original code. But then I realized, we don't need to clone new buttons at all. We can just re-assign the onclick function for the original Save and Apply buttons. For those who will find it useful, here is my adaptation of Ilya's original code which shows how you can add additional code\integrations to the existing Save and Apply buttons in Archer.

 

<script>
Sys.Application.add_load(function() {
$('#master_btnSave1').unbind('click').prop("onclick", null).click(function(){ ERM_Submit('Save');});
$('#master_btnApply1').unbind('click').prop("onclick", null).click(function(){ ERM_Submit('Apply');});
$('#master_btnApplyIcon').unbind('click').prop("onclick", null).click(function(){ ERM_Submit('Apply');});
});
function ERM_Submit(P_Action_Type) {
console.log('This is where the custom code goes');
javascript:ShowAnimationAndPostback('master$btn' + P_Action_Type);
return false;
};
</script>

Was this article helpful? Yes No
Version history
Last update:
‎2021-01-13 07:21 PM
Updated by:
Contributors