cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Object to hide Save/Save Close to re-enroll record

PeteErwin
Contributor III

Hi - trying to hide the Save/Save & Close buttons when user wants to re-enroll a completed ('Done') workflow record in Advanced Workflow.

This is what I have so far but still seeing Save / Save & Close.  what am I missing?  

TIA

// ------------------------------------

<script type="text/javascript">

Sys.Application.add_load( function() {
var value = ArcherTech.UI.GenericContent.GetInstance().getFieldValue(30407);
if (value == 'Done') {
$('#master_btnSave1').css('display', 'none');
$('#master_btnApply1').css('display', 'none');
}
});
</script>

// -------------------

2 ACCEPTED SOLUTIONS

Accepted Solutions

PeteErwin
Contributor III

solved it ......

<script type="text/javascript">
Sys.Application.add_load(function() {
if ($CM.getFieldValue(30407) == '126339:0') {
$('#master_btnSave1').css('display', 'none');
$('#master_btnApply1').css('display', 'none');
}
});
</script>

View solution in original post

getting the hang of this now!  and to hide the small Save icon added one more line.....

<script type="text/javascript">

Sys.Application.add_load(function() {
if ($CM.getFieldValue(30407) == '126339:0') {
$('#master_btnSave1').css('display', 'none');
$('#master_btnApply1').css('display', 'none');
$('#master_btnApplyIcon').css('display','none');
}
});
</script>

View solution in original post

5 REPLIES 5

DavidPetty
Archer Employee
Archer Employee

@PeteErwin, typically the ArcherTech.UI.GenericContent.GetInstance().getFieldValue() call returns the value id (1234:0) of the selected value if the values list isn't calculated.

 Advisory Consultant - Archer, an RSA Business

PeteErwin
Contributor III

Hi David - the status field is not calculated - it is set by AWF.  

Hi  - still working on this one - I took your suggestion + combined a few other scripts on the site... feels like I'm missing something obvious - the Save + Save and Close buttons are still showing.

<script type="text/javascript">

var valuesListFieldId = 30407; // This is the field id of the Risk Action Status values list
var valuesListValueId = 126339; // This is the id of the value 'Done' to check against

Sys.Application.add_load(function() {
var value = ArcherTech.UI.GenericContent.GetInstance().getFieldValue(valuesListFieldId);
if (value == valuesListValueId) {
$('#master_btnSave1').css('display', 'none');
$('#master_btnApply1').css('display', 'none');
}
});
</script>

PeteErwin
Contributor III

solved it ......

<script type="text/javascript">
Sys.Application.add_load(function() {
if ($CM.getFieldValue(30407) == '126339:0') {
$('#master_btnSave1').css('display', 'none');
$('#master_btnApply1').css('display', 'none');
}
});
</script>

getting the hang of this now!  and to hide the small Save icon added one more line.....

<script type="text/javascript">

Sys.Application.add_load(function() {
if ($CM.getFieldValue(30407) == '126339:0') {
$('#master_btnSave1').css('display', 'none');
$('#master_btnApply1').css('display', 'none');
$('#master_btnApplyIcon').css('display','none');
}
});
</script>