<?xml version="1.0" encoding="UTF-8"?>
|
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
|
<fullName>Must_Is_Class</fullName>
|
<active>true</active>
|
<description>科室处填写的必须是科室,opd计划上线时修改</description>
|
<errorConditionFormula>$User.ProfileId <>'00e10000000Y3o5'
|
&&
|
NOT($User.Batch_User__c)
|
&&
|
(Isnew() || Ischanged(Account__c)) && Not(Isblank(Account__c)) &&
|
OR (
|
/* 无效 ==> 报错 */
|
Text(Hospital__r.Is_Active__c) == "無効",
|
/* 看父记录,不是医院,不是经销商、 自己也不是医院 ==> 报错 */
|
Not(CASESAFEID(Account__r.RecordTypeId) = $Label.Department_ENT
|
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_GI
|
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_GS
|
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_GYN
|
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_OTH
|
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_URO
|
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_BF)
|
)</errorConditionFormula>
|
<errorDisplayField>Account__c</errorDisplayField>
|
<errorMessage>科室必须是战略科室下科室</errorMessage>
|
</ValidationRule>
|