<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40">
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>N52 Formula Manager</Author>
  <LastAuthor>N52 Formula Manager</LastAuthor>
  <Created>6/3/2016 12:26:11 PM</Created>
  <LastSaved>6/3/2016 12:26:11 PM</LastSaved>
  <Company>N52 Formula Manager</Company>
  <Version>12.00</Version>
 </DocumentProperties>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>10005</WindowHeight>
  <WindowWidth>10005</WindowWidth>
  <WindowTopX>110</WindowTopX>
  <WindowTopY>125</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Bottom"/>
   <Borders/>
   <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="10" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
 </Styles>
 <Worksheet ss:Name="Formula">
  <Table><Row>
<Cell><Data ss:Type="String">Name</Data></Cell>
<Cell><Data ss:Type="String">Formula Type</Data></Cell>
<Cell><Data ss:Type="String">Formula Description</Data></Cell>
<Cell><Data ss:Type="String">Status</Data></Cell>
<Cell><Data ss:Type="String">Status Reason</Data></Cell>
<Cell><Data ss:Type="String">Source Entity Name</Data></Cell>
<Cell><Data ss:Type="String">Source Entity Property</Data></Cell>
<Cell><Data ss:Type="String">Source Relationship</Data></Cell>
<Cell><Data ss:Type="String">Target Entity Name</Data></Cell>
<Cell><Data ss:Type="String">Target Entity Property</Data></Cell>
<Cell><Data ss:Type="String">Event</Data></Cell>
<Cell><Data ss:Type="String">Stage</Data></Cell>
<Cell><Data ss:Type="String">Display Format</Data></Cell>
<Cell><Data ss:Type="String">Auto Number Value</Data></Cell>
<Cell><Data ss:Type="String">Execution Order</Data></Cell>
<Cell><Data ss:Type="String">Message</Data></Cell>
<Cell><Data ss:Type="String">Enable PreValue Check</Data></Cell>
<Cell><Data ss:Type="String">Enable Find Function FetchXml Optimization</Data></Cell>
<Cell><Data ss:Type="String">Source Entity Property PreValue Check</Data></Cell>
<Cell><Data ss:Type="String">Category</Data></Cell>
<Cell><Data ss:Type="String">Sub Category</Data></Cell>
<Cell><Data ss:Type="String">Source Entity Property ClientSide</Data></Cell>
<Cell><Data ss:Type="String">Mode</Data></Cell>
<Cell><Data ss:Type="String">ShortCode</Data></Cell>
<Cell><Data ss:Type="String">Deployment Solution</Data></Cell>
<Cell><Data ss:Type="String">ClientSide Data Payload</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">Interaction - HD New Topic Button</Data></Cell>
<Cell><Data ss:Type="String">217890014</Data></Cell>
<Cell><Data ss:Type="String">/* HD New Topic Button */

if(ContainsData([bah_interactions.vhacrm_resolutionintersectionid]),
  
  if(([bah_interactions.bah_interactiontype_codename] = &#39;E-mail&#39; and ContainsData([bah_interactions.bah_veteranid])) or [bah_interactions.bah_interactiontype_codename] != &#39;E-mail&#39;,
  
  SmartFlow(

    SetVar(&#39;success&#39;, &#39;saveandnewsticky|vhacrm_parent_interactionid,current|bah_veteranid,lookup|vhacrm_vetfirstname_text,string|vhacrm_vetlastname_text,string|bah_ssn_text,string|vhacrm_edipi_text,string|bah_phonenumber_text,string|vhacrm_callbacknumber_text,string|vhacrm_emailaddress_text,string|vhacrm_noemailaddress_bool,bool|vhacrm_gender_code,optionset|bah_dob_date,date|bah_interactiontype_code,optionset&#39;),    

    SetVar(&#39;missinfomsg&#39;, &#39;In order to escalate, a Veteran, Case Note, Callback # and Email address must be set.  If no Email address, please indicate as such.&#39;),

    SetVar(&#39;isesc&#39;, ToString(FindValue(&#39;vhacrm_resolutionintersection&#39;, &#39;vhacrm_resolutionintersectionid&#39;, [bah_interactions.vhacrm_resolutionintersectionid], &#39;vhacrm_resultsinescalation_bool&#39;, false, true))),
    
    /* To escalate, have to have callback # and email.  If no email, the no email flag must be true */   
    if(ContainsData([bah_interactions.bah_veteranid]) and
      ((ContainsData([bah_interactions.vhacrm_callbacknumber_text]) and ContainsData([bah_interactions.vhacrm_emailaddress_text])) or
        (ContainsData([bah_interactions.vhacrm_callbacknumber_text]) and [bah_interactions.vhacrm_noemailaddress_bool] = 1)),
      SetVar(&#39;hascontactinfo&#39;, &#39;yes&#39;),
      SetVar(&#39;hascontactinfo&#39;, &#39;no&#39;)), 
    
    /* To escalate, have to have content in memo field or a related case note owned by user */
    if (GetVar(&#39;isesc&#39;) = &#39;True&#39; and ContainsData([bah_interactions.vhacrm_casenotes_memo]),
      SetVar(&#39;hascasenote&#39;, &#39;yes&#39;),
      SetVar(&#39;hascasenote&#39;, &#39;no&#39;)),   
    
    if (GetVar(&#39;isesc&#39;) = &#39;True&#39; and GetVar(&#39;hascasenote&#39;) = &#39;no&#39;,
      SetVar(&#39;hascasenote&#39;, FindValue(&#39;vhacrm_casenote&#39;, 
        SetFindAnd(&#39;vhacrm_interactionid&#39;, &#39;createdby&#39;), 
        SetFindAnd([bah_interactions.bah_interactionsid], [bah_interactions.owninguser]), 
        &#39;vhacrm_name&#39;, &#39;no&#39;, true)),
      SetVar(&#39;hascasenote&#39;, &#39;yes&#39;)),
    
    if (GetVar(&#39;isesc&#39;) = &#39;True&#39; and GetVar(&#39;hascasenote&#39;) != &#39;no&#39; and GetVar(&#39;hascontactinfo&#39;) != &#39;no&#39;,
      SetVar(&#39;hasescinfo&#39;, &#39;yes&#39;),
      SetVar(&#39;hasescinfo&#39;, &#39;no&#39;)),
    
    if(GetVar(&#39;isesc&#39;) != &#39;True&#39; or GetVar(&#39;hasescinfo&#39;) = &#39;yes&#39;, 
      SetVar(&#39;hasinfo&#39;, &#39;yes&#39;), 
      SetVar(&#39;hasinfo&#39;, &#39;no&#39;)),
    
    if(ContainsData([bah_interactions.vhacrm_lobid]), 
      SetVar(&#39;notename&#39;, [bah_interactions.vhacrm_lobidname]), 
      SetVar(&#39;notename&#39;, &#39;&#39;)),
    
    if(ContainsData([bah_interactions.vhacrm_typeintersectionid]), 
      SetVar(&#39;notename&#39;, GetVar(&#39;notename&#39;) + &#39;/&#39; + [bah_interactions.vhacrm_typeintersectionidname]), 
      &#39;NoOp&#39;),
    
    if(ContainsData([bah_interactions.vhacrm_areaintersectionid]), 
      SetVar(&#39;notename&#39;, GetVar(&#39;notename&#39;) + &#39;/&#39; + [bah_interactions.vhacrm_areaintersectionidname]), 
      &#39;NoOp&#39;),
    
    if (ContainsData([bah_interactions.vhacrm_subareaintersectionid]), 
        SetVar(&#39;notename&#39;, GetVar(&#39;notename&#39;) + &#39;/&#39; + [bah_interactions.vhacrm_subareaintersectionidname]), 
        &#39;NoOp&#39;),
    
    if(GetVar(&#39;hasinfo&#39;) = &#39;yes&#39; and ContainsData([bah_interactions.vhacrm_casenotes_memo]),
      CreateRecord(&#39;vhacrm_casenote&#39;,
        SetAttribute(&#39;vhacrm_name&#39;, GetVar(&#39;notename&#39;)),
        SetAttribute(&#39;vhacrm_casenotes_memo&#39;, [bah_interactions.vhacrm_casenotes_memo] ),
        SetAttributeLookup(&#39;vhacrm_interactionid&#39;, &#39;bah_interactions&#39;,[bah_interactions.bah_interactionsid]),
        SetAttributeLookup(&#39;vhacrm_veteranid&#39;, &#39;contact&#39;,[bah_interactions.bah_veteranid]),
        SetAttributeLookup(&#39;vhacrm_casenotetemplateid&#39;, &#39;vhacrm_casenotetemplate&#39;, [bah_interactions.vhacrm_casenotetemplateid]),
        SetAttribute(&#39;vhacrm_casenotetype_code&#39;,  168790000)),
      &#39;NoOp&#39;),
    
    if(GetVar(&#39;hasinfo&#39;) = &#39;yes&#39;,
      UpdateRecord(&#39;bah_interactions&#39;, [bah_interactions.bah_interactionsid],
        SetAttribute(&#39;vhacrm_casenotes_memo&#39;, &#39;&#39;),
        SetAttribute(&#39;vhacrm_casenotetemplateid&#39;, &#39;?&#39;),
        SetAttributeStatus(1, 2)),
      &#39;NoOp&#39;),
    

    if(GetVar(&#39;hasinfo&#39;) = &#39;no&#39;,
      SetVar(&#39;return&#39;, GetVar(&#39;missinfomsg&#39;)),
      SetVar(&#39;return&#39;, GetVar(&#39;success&#39;))),
    
    SmartFlowReturn(GetVar(&#39;return&#39;))
    
     ),
    
    &#39;Veteran information must be provided if the Interaction is an E-mail.&#39;),
  
  &#39;A Resolution must be provided before completing the interaction.&#39;
)</Data></Cell>
<Cell><Data ss:Type="String">0</Data></Cell>
<Cell><Data ss:Type="String">1</Data></Cell>
<Cell><Data ss:Type="String">bah_interactions</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String">217890002</Data></Cell>
<Cell><Data ss:Type="String">217890002</Data></Cell>
<Cell><Data ss:Type="String">217890000</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String">False</Data></Cell>
<Cell><Data ss:Type="String">True</Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String">217890001</Data></Cell>
<Cell><Data ss:Type="String">7OZ</Data></Cell>
<Cell><Data ss:Type="String">North52FormulaManagerDeploymentSolution</Data></Cell>
<Cell><Data ss:Type="String">*:CreateUpdate</Data></Cell>
</Row>

  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>6</ActiveRow>
     <ActiveCol>1</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>