I have the following code on a button
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/22.0/apex.js")}
if (({!Service_Call__c.Incomplete_Parts_Count__c} > 0))
{
alert( "Error: One or more parts on this call have not been completely filled out. Update parts before releasing." );
}
else {
var newRecords = [];
var c = new sforce.SObject("Service_Call__c");
c.id ="{!Service_Call__c.Id}";
c.Release__c = true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.reload();
}
It works as long as there is some type of number in that field, but sometimes it is just null and it causes this error. I've tried to manipulate my if statement to include the null, but I don't really know how. Any help would be appreciated. Thanks!
Service_Call__c.Incomplete_Parts_Count__c
toBLANKVALUE(Service_Call__c.Incomplete_Parts_Count__c, 0)
?