Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2019-11-12 11:42 AM
Hello! I recently decided to add a submit button to a questionnaire and am now having some issues. It is supposed to change a value and then save & close the file. However, it says "Saving..." and then says "There are unsaved changes do you still want to close the file?" Instead of just saving and closing like it did in the past. What's wrong with the way I'm doing it? Here is the code:
<div class="toolbar-app-buttons-left">
<a title="Set Value" class="tb-btn-link-left" id="btnSetValue" href="javascript:void(0);" data-check-dirty="false">
<div class="tb-btn" data-icon="" data-icon-pos="left">Submit</div>
</a>
</div>
<script type="text/javascript">
var integration = {
statusFieldId:"<correct ID is here>",
statusSubmit:"<correct ID is here>"
};
$('#btnSetValue').click(function(){
UpdatesValueList(integration.statusFieldId, integration.statusSubmit);
ShowAnimationAndPostback('master$btnSave')
});
function UpdatesValueList(changeId, assignedValue) {
var valueArray = new Array(1);
valueArray[0] = assignedValue;
$CM.setFieldValue(changeId, valueArray, '');
}
</script>
2019-11-12 12:22 PM
Try to use:
$('#master_btnSave').click();
instead of
ShowAnimationAndPostback('master$btnSave')
2019-11-12 12:22 PM
Try to use:
$('#master_btnSave').click();
instead of
ShowAnimationAndPostback('master$btnSave')
2019-11-12 03:14 PM
Perfect, thank you!!! Why does the line you wrote work while mine doesn't?
2019-11-12 03:17 PM
Well, clicking on submit of btnSave is emulating direct user click
2019-11-12 03:19 PM
Amy, the ShowAnimationAndPostback('master$btnSave') was used back in the 5.x days and the way Archer saves records in 6.x is handle differently now
Advisory Consultant
2019-11-12 03:22 PM
And I see that this code is returning back in 6.7 At least I saw it on new Save1 and Apply1 buttons.
2019-11-13 08:53 AM
Thank you guys so much!! I really appreciate it!
2019-11-22 07:01 AM
$('#master_btnSave').click(); this one creating non stop loop .
2019-11-22 07:13 AM
You probably have hijacked the original save button then or have another piece of code during realod.
Hard to say without full picture.
2019-11-22 07:34 AM
Thank you, buddy, for the quick reply below code kind of sends one more click event to the save click event and it goes into the loop:
$('#btnSetValue').click(function(){
UpdatesValueList(integration.statusFieldId, integration.statusSubmit);
$('#master_btnSave').click();
});
So instead I am just passing only validation function to this and it works now :
$('#master_btnApply').click(function(){
varHelperIsupdated = check_and_populate_Process();
});
Thanks a lot : )