<?xml version="1.0" encoding="UTF-8"?> 
 | 
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>Only_OPDtoSIS</fullName> 
 | 
    <active>true</active> 
 | 
    <description>OPD和SIS</description> 
 | 
    <errorConditionFormula>ISCHANGED(RecordTypeId) && 
 | 
( 
 | 
/**OPD或SIS变到非OPDSIS**/ 
 | 
 ((PRIORVALUE(RecordTypeId) = "01210000000RLTi" 
 | 
  || 
 | 
 PRIORVALUE(RecordTypeId) = "01210000000Qekj")  
 | 
 &&  
 | 
 (RecordTypeId <> "01210000000RLTi" 
 | 
  && 
 | 
 RecordTypeId <> "01210000000Qekj")) 
 | 
|| 
 | 
/**非OPDSIS变到OPD或SIS**/ 
 | 
 ((PRIORVALUE(RecordTypeId) <> "01210000000RLTi" 
 | 
  && 
 | 
 PRIORVALUE(RecordTypeId) <> "01210000000Qekj")  
 | 
 &&  
 | 
 (RecordTypeId = "01210000000RLTi" 
 | 
  || 
 | 
 RecordTypeId = "01210000000Qekj")) 
 | 
)</errorConditionFormula> 
 | 
    <errorMessage>只能在OPD报告书和SIS报告书的类型之间相互变换</errorMessage> 
 | 
</ValidationRule> 
 |