{!REQUIRESCRIPT("/soap/ajax/27.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/27.0/apex.js")}
if ( {!ISBLANK( SVMXC__Service_Group__c.QADCode__c )} ){
alert('This team has no customer code, so we can not ship to them');
}
else if ({!CONTAINS("PEND", UPPER (SVMXC__Service_Group__c.QADCode__c))} ) {
alert('pend error');
}
else{
document.location.href="/apex/SVMX_Create_SalesOrder_ST?id={!SVMXC__Service_Group__c.Id}";
}
3 réponses

Use this:
var pendTest = '{!SVMXC__Service_Group__c.QADCode__c}';
if(pendTest.indexOf("pend") !== -1){
alert("pend found");
}else{
alert("pend not found")
}