Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2024-02-15 07:50 AM
Hi,
I am trying to set a value list field using a custom object. The code is working only when I click on the button after saving the record. I want the value to set when I click on the button and there should be no dependency on save.
Please let me know what correction I can do in below 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">Set Value</div>
</a>
</div>
<script type="text/javascript">
var integration = {
statusFieldId:"20458",
statusSubmit:"72568"
};
$('#btnSetValue').click(function(){
UpdateValuesList(integration.statusFieldId, integration.statusSubmit);
});
function UpdateValuesList(changeId, assignedValue) {
var valueArray = new Array(1);
valueArray[0] = assignedValue;
$CM.setFieldValue(changeId, valueArray, '');
}
</script>