You need to sign in to do that
Don't have an account?
Tsvety
Onclick javascript button works for some users and doesn't for others
Hi,
This might be something simple, but I cannot figure it out.
The below button works for some users and doesn't for others.
Here is the code:
{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")}
if({!ts2__Offer__c.Estimated_Gross_Margin__c}<40)
{
alert("The margin for this Resource is less than 40%. An automatic request for approval will be sent to the executive team");}
else{ alert ("Completed");
}
Here is the error I get:
This might be something simple, but I cannot figure it out.
The below button works for some users and doesn't for others.
Here is the code:
{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")}
if({!ts2__Offer__c.Estimated_Gross_Margin__c}<40)
{
alert("The margin for this Resource is less than 40%. An automatic request for approval will be sent to the executive team");}
else{ alert ("Completed");
}
Here is the error I get:
All Answers
{!ts2__Offer__c.Estimated_Gross_Margin__c}
contain?If it is null or the empty string for some records then the javascript is likely to be something like the following, which would explain the JavaScript error.
You may need to add additional checks for empty values first.
The
{!ts2__Offer__c.Estimated_Gross_Margin__c} is a Formula (Percent) field.
Please note that the button works for some users and on exactly the same record, it doesn't work for others.
I doublechecked and even though the field was visible to the user, there were some restrictions in regards to the field level security. I changed it so now the button works!
Thanks for your help!
Other than that, are they using a different browser version by chance? The screenshot you supplied makes me think it is a version of Chrome.