function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CushtyCushty 

OnclickJava button salesforce if statement with AND not working

Hi,

I have a custom button on opportunities which when clicked runs approval processes depending on fields creitera.  I am trying to check if certain fields are filled out before the button is clicked and getting stuck on a multiple if statement with AND all being true.  Basically if a URL field is blank, a picklist is 'tender' and a number field is greater than 99999: -

if('{!Opportunity.Field_1__c}' == "" && '{!Opportunity.Field_2__c}' == "Tender" && '{!Opportunity.Field_3__c}' > 99999) {
     alert('You need to enter the Final Pricing Sharepoint URL for this Tender before submitting for approval');
} else {

Field_1__c - URL field
Field _2__c - Picklist
Field_3__c - Number field

I get no errors on the Java and also there is no error message shows when the button is clicked and all of the above is met

Any Ideas...
Thanks