2014-01-17 38 views
0

我有以下JavaScript用JavaScript列表按鈕打開一個窗口

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")} 
if({!Account.Credit_Status__c}='REJECTED') { 
window.alert ("New Opportunity cannot be created when Account Credit Status = Rejected"); 
} 
else { 
window.open('/006/e?retURL=%2F{!Account.Id}&accid={!Account.Id}&opp11=Prospecting'); 
} 

這工作列表按鈕時,帳戶狀態=拒絕,但如果狀態不是。我收到了這個錯誤信息「Expected)」我嘗試過不同的東西,但無濟於事。

回答

0

您應該檢查double = (==)

例如:

if({!Account.Credit_Status__c}=='REJECTED') { ...