仅当所有验证规则和系统验证通过时,才在Salesforce Custom VF页面中显示警报消息?

时间:2017-11-09 16:51:03

标签: javascript visualforce

我正在使用Salesforce visualforce + javascript。在我的组织中。我有Type和SubType值如果Type='Authorization'Sub-Type='Basic',那么我需要在Case保存按钮上单击显示 alter message ,仅当所有验证规则都通过且系统验证通过时。如果任何验证失败,我不想显示该警报消息。

有人可以建议我需要做出哪些更改吗?

function customAlert(type, subType){
    if(type == 'Authorization' && subType == 'Basic'){
        alert('This sample acceptance policy outlines the minimum conditions a sample must meet upon receipt by the UGRA Environmental Laboratory.  The following conditions must be met in order for samples to be accepted by UGRA for analysis without qualification.');
    }    
}

这是Visualforce按钮页面,

<apex:pageblockButtons >  
    <apex:commandButton id="mysave" action="{!save}" value="Save" rerender="caseForm" oncomplete="customAlert('{!currentCase.type}' ,'{!currentCase.Subtype}');" status="btnStatus"/>                                                                               
</apex:pageblockButtons>

0 个答案:

没有答案