<?xml version="1.0" encoding="UTF-8"?>
<Workflow xmlns="http://soap.sforce.com/2006/04/metadata">
    <alerts>
        <fullName>ContactPassEmail</fullName>
        <description>联系人通过邮件</description>
        <protected>false</protected>
        <recipients>
            <field>SubmitUser__c</field>
            <type>userLookup</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>Account/SSBGContactPass_New</template>
    </alerts>
    <alerts>
        <fullName>ContactPassEmail_Change</fullName>
        <description>联系人通过邮件(修改)</description>
        <protected>false</protected>
        <recipients>
            <field>SubmitUser__c</field>
            <type>userLookup</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>Account/SSBGContactPass_New</template>
    </alerts>
    <alerts>
        <fullName>ContactRejectEmail</fullName>
        <description>联系人驳回邮件</description>
        <protected>false</protected>
        <recipients>
            <field>SubmitUser__c</field>
            <type>userLookup</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>Account/SSBGContactReject_New</template>
    </alerts>
    <alerts>
        <fullName>ContactRejectEmail_Change</fullName>
        <description>联系人驳回邮件(修改)</description>
        <protected>false</protected>
        <recipients>
            <field>SubmitUser__c</field>
            <type>userLookup</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>Account/SSBGContactReject_New</template>
    </alerts>
    <fieldUpdates>
        <fullName>ContactApprove</fullName>
        <field>StatusD__c</field>
        <literalValue>Pass</literalValue>
        <name>更新联系人状态-批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>ContactInitial</fullName>
        <field>StatusD__c</field>
        <literalValue>Draft</literalValue>
        <name>更新联系人状态-草案中</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>ContactPass</fullName>
        <field>StatusD__c</field>
        <literalValue>Pass</literalValue>
        <name>联系人批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>ContactReject</fullName>
        <field>StatusD__c</field>
        <literalValue>Reject</literalValue>
        <name>更新联系人状态-驳回</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>ContactSubmit</fullName>
        <field>StatusD__c</field>
        <literalValue>Submit</literalValue>
        <name>更新联系人状态-已提交</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>Contact_Approval</fullName>
        <field>RecordTypeId</field>
        <lookupValue>SSBD_Approval</lookupValue>
        <lookupValueType>RecordType</lookupValueType>
        <name>更新联系人记录类型-提交</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>LookupValue</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>Contact_Normal</fullName>
        <field>RecordTypeId</field>
        <lookupValue>SSBD</lookupValue>
        <lookupValueType>RecordType</lookupValueType>
        <name>更新联系人记录类型-一般</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>LookupValue</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>FieldUpdate</fullName>
        <description>服务部在客户BS下创建联系人、服务部创建联系人NDT/ANI 不需要审批，更新审批状态字段。</description>
        <field>StatusD__c</field>
        <literalValue>Pass</literalValue>
        <name>状态更新</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
        <reevaluateOnChange>true</reevaluateOnChange>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>TechnicalServiceCreatedContact</fullName>
        <field>TechnicalServiceCreated__c</field>
        <literalValue>1</literalValue>
        <name>技术服务部创建联系人</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>isServiceCreate</fullName>
        <field>isServiceCreate__c</field>
        <literalValue>1</literalValue>
        <name>是否服务部创建</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
        <reevaluateOnChange>true</reevaluateOnChange>
    </fieldUpdates>
    <rules>
        <fullName>市场部创建联系人</fullName>
        <actions>
            <name>ContactPass</name>
            <type>FieldUpdate</type>
        </actions>
        <active>true</active>
        <formula>($Profile.Id =&apos;00e28000000YQMs&apos; || $Profile.Id = &apos;00e0K000002NxHr&apos;) &amp;&amp;  TEXT( StatusD__c )  &lt;&gt; &apos;Pass&apos;</formula>
        <triggerType>onAllChanges</triggerType>
    </rules>
    <rules>
        <fullName>技术服务部创建联系人标记</fullName>
        <actions>
            <name>TechnicalServiceCreatedContact</name>
            <type>FieldUpdate</type>
        </actions>
        <active>true</active>
        <formula>OR($Profile.Id = &apos;00e28000001sZE6&apos;,$Profile.Id = &apos;00e28000000YQMx&apos;, CreatedBy.Id = &apos;00528000000YWE7&apos;, CreatedBy.Id =&apos;00528000000YVGg&apos;, CreatedBy.Id = &apos;0050K000009U4II&apos;, CreatedBy.Id = &apos;0050K000009U4ID&apos;, CreatedBy.Id = &apos;00528000000YWC6&apos;)</formula>
        <triggerType>onCreateOnly</triggerType>
    </rules>
    <rules>
        <fullName>是否服务部创建</fullName>
        <actions>
            <name>isServiceCreate</name>
            <type>FieldUpdate</type>
        </actions>
        <active>false</active>
        <formula>OR(CreatedById = &apos;00528000000YWC6&apos;,CreatedById = &apos;00528000000YWE7&apos;, $Profile.Id = &apos;00e28000000YQMx&apos;, $Profile.Id = &apos;00e28000001sZE6&apos;)</formula>
        <triggerType>onCreateOnly</triggerType>
    </rules>
    <rules>
        <fullName>是否服务部创建_NEW</fullName>
        <actions>
            <name>isServiceCreate</name>
            <type>FieldUpdate</type>
        </actions>
        <active>true</active>
        <formula>OR(CreatedById = &apos;00528000000YWC6&apos;,CreatedById = &apos;00528000000YWE7&apos;, CONTAINS($Label.TechnicalService,LEFT($User.Id,15)))</formula>
        <triggerType>onCreateOnly</triggerType>
    </rules>
    <rules>
        <fullName>服务部创建联系人</fullName>
        <actions>
            <name>FieldUpdate</name>
            <type>FieldUpdate</type>
        </actions>
        <active>true</active>
        <description>服务部在BS客户下创建联系人，创建NDT/ANI联系人不需要审批</description>
        <formula>AND( isServiceCreate__c = true,OR(AND(text( Account.ProductSegment__c) = &apos;BS&apos;, Account.serviceCreate__c = true),text(Account.ProductSegment__c) = &apos;NDT&apos;,text(Account.ProductSegment__c) = &apos;ANI&apos;))</formula>
        <triggerType>onAllChanges</triggerType>
    </rules>
</Workflow>
