Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2024-06-30 10:22 AM
I have a custom button that is created and used to set a field in the record. The button is displayed next to the save and close button. I'm trying to hide this button (or only show it) if a field contains a certain value.
My code to create the button (this works perfectly):
<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">RE-OPEN</div>
</a>
</div>
<script type="text/javascript">
var integration = {
statusFieldId:"28451",
statusSubmit:"90422"
};
$("#btnSetValue").insertAfter('#master_btnSave1');
$('#btnSetValue').click(function(){
UpdateValuesList(integration.statusFieldId, integration.statusSubmit);
$("#master_btnApply").click();
});
function UpdateValuesList(changeId, assignedValue) {
var valueArray = new Array(1);
valueArray[0] = assignedValue;
$CM.setFieldValue(changeId, valueArray, '');
}
</script>
My code to hide the button if the status is 1 of 3 values (this is not working):
<script type="text/javascript">
var valuesListFieldId = 28426;
var valuesListValueId = 90397;
var valuesListValueAId = 90399;
var valuesListValueCId = 90400;
var valuesListValue;
Sys.Application.add_load( function() {
valuesListValue=$('div[id*="f' + valuesListFieldId +'c"] div:last').attr('data-valueslistvalueid');
if(valuesListValue == valuesListValueId || valuesListValue == valuesListValueAId || valuesListValue == valuesListValueBId || valuesListValue == valuesListValueCId) {
$('#btnSetValue').hide();
});
</script>
2024-07-17 06:55 AM - edited 2024-07-18 05:20 PM
Hi Christina,
Please give this script a try and let me know if you encounter any issues.
2024-07-17 06:55 AM - edited 2024-07-18 05:20 PM