Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLOW: Find Gift Recipient or create as needed #186

Open
wants to merge 2 commits into
base: metecho/june-2024-mini-sprint
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
<type>Region</type>
</flexiPageRegions>
<flexiPageRegions>
<itemInstances>
<fieldInstance>
<fieldItem>Record.Recipient__c</fieldItem>
<identifier>RecordRecipient__cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.Recipient_Import_Status__c</fieldItem>
<identifier>RecordRecipient_Import_Status__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-b79cc4cf-4e40-45ad-a1af-4b84b0736f05</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
<type>Region</type>
</flexiPageRegions>
<flexiPageRegions>
<itemInstances>
<fieldInstance>
<fieldItem>Record.Recipient__c</fieldItem>
<identifier>RecordRecipient__cField</identifier>
</fieldInstance>
</itemInstances>
<itemInstances>
<fieldInstance>
<fieldItem>Record.Recipient_Import_Status__c</fieldItem>
<identifier>RecordRecipient_Import_Status__cField</identifier>
</fieldInstance>
</itemInstances>
<name>Facet-b79cc4cf-4e40-45ad-a1af-4b84b0736f05</name>
<type>Facet</type>
</flexiPageRegions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>49.0</apiVersion>
<assignments>
<name>Update_MFS_Error_Create</name>
<label>Update MFS - Error</label>
<locationX>314</locationX>
<locationY>602</locationY>
<assignmentItems>
<assignToReference>Get_MFS_record.Status__c</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Failed</stringValue>
</value>
</assignmentItems>
<assignmentItems>
<assignToReference>Get_MFS_record.Failure_Information__c</assignToReference>
<operator>Assign</operator>
<value>
<stringValue>Unable to create recipient contact record</stringValue>
</value>
</assignmentItems>
<connector>
<isGoTo>true</isGoTo>
<targetReference>Update_MFS</targetReference>
</connector>
</assignments>
<assignments>
<name>Update_MFS_Success</name>
<label>Update MFS - Success</label>
<locationX>50</locationX>
<locationY>602</locationY>
<assignmentItems>
<assignToReference>Get_MFS_record.Recipient__c</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Create_Recipient</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Update_MFS</targetReference>
</connector>
</assignments>
<assignments>
<name>Update_MFS_Sucess</name>
<label>Update MFS - Sucess</label>
<locationX>578</locationX>
<locationY>494</locationY>
<assignmentItems>
<assignToReference>Get_MFS_record.Contact__c</assignToReference>
<operator>Assign</operator>
<value>
<elementReference>Get_MFS_Recipient.Id</elementReference>
</value>
</assignmentItems>
<connector>
<targetReference>Update_MFS</targetReference>
</connector>
</assignments>
<decisions>
<name>Recipient_Exists</name>
<label>Recipient Exists?</label>
<locationX>314</locationX>
<locationY>386</locationY>
<defaultConnector>
<targetReference>Update_MFS_Sucess</targetReference>
</defaultConnector>
<defaultConnectorLabel>Yes, Find</defaultConnectorLabel>
<rules>
<name>No_Create</name>
<conditionLogic>and</conditionLogic>
<conditions>
<leftValueReference>Get_MFS_Recipient</leftValueReference>
<operator>IsNull</operator>
<rightValue>
<booleanValue>true</booleanValue>
</rightValue>
</conditions>
<connector>
<targetReference>Create_Recipient</targetReference>
</connector>
<label>No, Create</label>
</rules>
</decisions>
<description>PE triggered flow, finds or creates a contact for the Gift Recipient from Membership Submission Form record.</description>
<environments>Default</environments>
<formulas>
<description>Combines the two street address lines</description>
<name>forBillingStreet</name>
<dataType>String</dataType>
<expression>{!Get_MFS_record.RecipientStreet__c} + &quot; &quot; + {!Get_MFS_record.RecipientStreet2__c}</expression>
</formulas>
<interviewLabel>DPEV Listener - Find/Create Recipient {!$Flow.CurrentDateTime}</interviewLabel>
<label>DPEV Listener - Find/Create Recipient</label>
<processMetadataValues>
<name>BuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>CanvasMode</name>
<value>
<stringValue>AUTO_LAYOUT_CANVAS</stringValue>
</value>
</processMetadataValues>
<processMetadataValues>
<name>OriginBuilderType</name>
<value>
<stringValue>LightningFlowBuilder</stringValue>
</value>
</processMetadataValues>
<processType>AutoLaunchedFlow</processType>
<recordCreates>
<name>Create_Recipient</name>
<label>Create Recipient</label>
<locationX>50</locationX>
<locationY>494</locationY>
<connector>
<targetReference>Update_MFS_Success</targetReference>
</connector>
<faultConnector>
<targetReference>Update_MFS_Error_Create</targetReference>
</faultConnector>
<inputAssignments>
<field>Email</field>
<value>
<elementReference>Get_MFS_record.RecipientEmail__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>FirstName</field>
<value>
<elementReference>Get_MFS_record.RecipientFirstName__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>LastName</field>
<value>
<elementReference>Get_MFS_record.RecipientLastName__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>MailingCity</field>
<value>
<elementReference>Get_MFS_record.RecipientCity__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>MailingCountry</field>
<value>
<elementReference>Get_MFS_record.RecipientCountry__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>MailingPostalCode</field>
<value>
<elementReference>Get_MFS_record.RecipientZip__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>MailingState</field>
<value>
<elementReference>Get_MFS_record.RecipientState__c</elementReference>
</value>
</inputAssignments>
<inputAssignments>
<field>MailingStreet</field>
<value>
<elementReference>forBillingStreet</elementReference>
</value>
</inputAssignments>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordCreates>
<recordLookups>
<description>Get the Gift Recipient from the MFS record</description>
<name>Get_MFS_Recipient</name>
<label>Get MFS Recipient</label>
<locationX>314</locationX>
<locationY>278</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Recipient_Exists</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Email</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_MFS_record.RecipientEmail__c</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Contact</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordLookups>
<name>Get_MFS_record</name>
<label>Get MFS record</label>
<locationX>314</locationX>
<locationY>170</locationY>
<assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
<connector>
<targetReference>Get_MFS_Recipient</targetReference>
</connector>
<filterLogic>and</filterLogic>
<filters>
<field>Id</field>
<operator>EqualTo</operator>
<value>
<elementReference>Get_MFS_record.Id</elementReference>
</value>
</filters>
<getFirstRecordOnly>true</getFirstRecordOnly>
<object>Membership_Form_Submission__c</object>
<storeOutputAutomatically>true</storeOutputAutomatically>
</recordLookups>
<recordUpdates>
<name>Update_MFS</name>
<label>Update MFS</label>
<locationX>314</locationX>
<locationY>884</locationY>
<inputReference>Get_MFS_record</inputReference>
</recordUpdates>
<start>
<locationX>188</locationX>
<locationY>0</locationY>
<connector>
<targetReference>Get_MFS_record</targetReference>
</connector>
<object>DPEV_Gift_Recipient_Finder__e</object>
<triggerType>PlatformEvent</triggerType>
</start>
<status>Active</status>
</Flow>
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Return the Opportunity</description>
<object>DPEV_Membership_Finder__e</object>
<triggerType>PlatformEvent</triggerType>
</start>
<status>Draft</status>
<status>Active</status>
<variables>
<description>Variable to hold Opportunity Line item to be updated</description>
<name>OpportunityProductforUpdate</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,16 @@
<behavior>Edit</behavior>
<field>Price_Book_Entry__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>Recipient__c</field>
</layoutItems>
</layoutColumns>
<layoutColumns>
<layoutItems>
<behavior>Edit</behavior>
<field>Account_Import_Status__c</field>
</layoutItems>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>Source_Code__c</field>
Expand All @@ -205,6 +209,10 @@
<behavior>Edit</behavior>
<field>Product_Import_Status__c</field>
</layoutItems>
<layoutItems>
<behavior>Edit</behavior>
<field>Recipient_Import_Status__c</field>
</layoutItems>
</layoutColumns>
<style>TwoColumnsLeftToRight</style>
</layoutSections>
Expand Down Expand Up @@ -247,7 +255,7 @@
<showRunAssignmentRulesCheckbox>false</showRunAssignmentRulesCheckbox>
<showSubmitAndAttachButton>false</showSubmitAndAttachButton>
<summaryLayout>
<masterLabel>00h8F000004BIMn</masterLabel>
<masterLabel>00h01000003MHOY</masterLabel>
<sizeX>4</sizeX>
<sizeY>0</sizeY>
<summaryLayoutStyle>Default</summaryLayoutStyle>
Expand Down
Loading