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 - Archer, an RSA Business

View solution in original post

2 REPLIES 2

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 - Archer, an RSA Business

Many thank you David for advice, it works now.