Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger check of unsaved data with a custom object

FrancoisNal1
Contributor

Hello everyone,

 

I have build a custom object who retrieve data from the record to send it through Ajax to an external system. To make it more reliable, I would like to make sure that the current record is saved before sending the data.

 

I though of using the check that Archer makes before leaving an incident (the warning for unsaved data). How could I make possible with javascript to trigger this check?

 

So far I have build a button looking as close as possible to the "close", "view", etc buttons but with no success. Nothing happen when clicking on the button even though I have modified some fields.

 

Here is my test code, I'm using a Archer 6.4:

<div style="width:5%; display:inline-block; padding-top:1px;">
<a id="master_btnTest" class="tb-btn-link-left" href="javascript:test_test()" title="Test" aria-disabled="false" role="button" data-check-dirty="true">
<div class="tb-btn " data-icon-pos="left" data-icon="">Test</div>
</a>
</div>

<script type="text/javascript">
function test_test()
{
console.log("test");
}
</script>‍‍‍‍‍‍‍‍‍‍‍‍

 

Thanks in advance for your help.

 

Regards,

 

François

2 REPLIES 2

Arun.Prasad
Advocate II

This thread might give you some insights.. You can call the "close" button when someone hits your custom button.

Custom Object - Close Button 

Thanks Arun, but I'm not trying to reproduce a close button or any existing button. I want an independent button that will trigger my own script with a check for unsaved data as the same time.