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

cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Initiate button on default layout when a record is completed.

PawelKotarba
Contributor II

Previously used a custom object field to hide the function button when the status of the record contains 'closed'. Since 6.7 P3 the custom object has stopped working. Is there any way to hide the AWF initiate button?

 

<script type="text/javascript">
var valuesListFieldId = 480;
var valuesListValueId = 732;
var valuesListValueAId = 71713;
var valuesListValueCId = 69447;
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) {
$("a[title='Update or Close Record]").hide();
});
</script>

1 ACCEPTED SOLUTION

Accepted Solutions

DavidPetty
Archer Employee
Archer Employee

Pawel, try replacing this line

$("a[title='Update or Close Record]").hide();

with

$('.tb-btn-link-left:contains("Update or Close Record")').hide();

 Advisory Consultant

View solution in original post

3 REPLIES 3

DavidPetty
Archer Employee
Archer Employee

Pawel, try replacing this line

$("a[title='Update or Close Record]").hide();

with

$('.tb-btn-link-left:contains("Update or Close Record")').hide();

 Advisory Consultant

Many thank you David for advice, it works now. 

Devi
Contributor III

@PawelKotarba were you able to manage to hide the AWF Button using the above code.

I have the button with name "Next" as shown below.  Can you help me how to use the button name in the above script you wrote. I tried and its not working for me.

Next Button.png

I tried below code, but not working :

<script type="text/javascript">
var valuesListFieldId = 15103; //Status ValueList field
var valuesListValueId = 124852; //Valuelist Value "Close"
var valuesListValue;

Sys.Application.add_load( function() {
valuesListValue=$('div[id*="f' + valuesListFieldId +'c"] div:last').attr('data-valueslistvalueid'); // Not sure the exact functionality of this line

if(valuesListValue == valuesListValueId) {
$('.tb-btn-link-left:contains("Next")').hide(); // AWF Button Next
});
</script>