From a80bd7925749e6b861937c8bd483bd1e78526ed4 Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Fri, 27 Sep 2024 14:38:05 -0400 Subject: [PATCH 1/3] Pulling in new flow: DPEV Listener - Membership Create Flow --- ...tener_Membership_Create_Flow.flow-meta.xml | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml diff --git a/force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml b/force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml new file mode 100644 index 0000000..55392d2 --- /dev/null +++ b/force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml @@ -0,0 +1,198 @@ + + + 61.0 + + Create a membership record with the following: Product__c = purchased product Contact__c = recipient contact on the membership form submission Account__c = recipient account on the membership form submission End Date = calculate the correct end date based upon the product purchased + Map_Membership_Variables + + 176 + 386 + + newMembership.Account__c + Assign + + Query_Membership_Form_Submission.Account__c + + + + newMembership.Opportunity__c + Assign + + Query_Membership_Form_Submission.Opportunity__c + + + + newMembership.Product__c + Assign + + Query_Opportunity_Product.Product2Id + + + + newMembership.Start_Date__c + Assign + + $Flow.CurrentDate + + + + newMembership.Status__c + Assign + + Current + + + + newMembership.Name + Assign + + membershipName + + + + newMembership.Primary_Contact__c + Assign + + Query_Membership_Form_Submission.Contact__c + + + + newMembership.End_Date__c + Assign + + calculatedEndDate + + + + Create_Membership + + + Listens for the Platform Event: Create Membership, and creates a Membership record based on data in the Membership Form Submission. + Default + + calculatedEndDate + Date + IF( +TEXT({!Query_Opportunity_Product.Product2.Term_Unit__c}) = 'Day', +{!newMembership.Start_Date__c} + {!Query_Opportunity_Product.Product2.Term__c}, + IF( + TEXT( {!Query_Opportunity_Product.Product2.Term_Unit__c} )= 'Week', + {!newMembership.Start_Date__c} + ({!Query_Opportunity_Product.Product2.Term__c}*7), + IF( + TEXT( {!Query_Opportunity_Product.Product2.Term_Unit__c}) = 'Month', + {!newMembership.Start_Date__c} + ({!Query_Opportunity_Product.Product2.Term__c}*30.14), + IF( + TEXT( {!Query_Opportunity_Product.Product2.Term_Unit__c}) = 'Year', + {!newMembership.Start_Date__c} + ({!Query_Opportunity_Product.Product2.Term__c}*364), + null + ) + ) + ) + +) + + + membershipName + String + LEFT( +{!Query_Membership_Form_Submission.Account__r.Name} ++" _ "+ +{!Query_Opportunity_Product.Product2.Name} ++" _ "+ +TEXT({!$Flow.CurrentDate}) + +,80) + + DPEV Listener - Membership Create Flow {!$Flow.CurrentDateTime} + + + BuilderType + + LightningFlowBuilder + + + + CanvasMode + + AUTO_LAYOUT_CANVAS + + + + OriginBuilderType + + LightningFlowBuilder + + + AutoLaunchedFlow + + Create_Membership + + 176 + 494 + newMembership + + + retrieve the Membership Form Submission that created the Platform Event. + Query_Membership_Form_Submission + + 176 + 170 + false + + Query_Opportunity_Product + + and + + Id + EqualTo + + $Record.Record_Id__c + + + true + Membership_Form_Submission__c + true + + + Link the most recently created product on the opportunity line item for the opportunity linked to the membership form submission + Query_Opportunity_Product + + 176 + 278 + false + + Map_Membership_Variables + + and + + OpportunityId + EqualTo + + Query_Membership_Form_Submission.Opportunity__c + + + true + OpportunityLineItem + CreatedDate + Desc + true + + + 50 + 0 + + Query_Membership_Form_Submission + + DPEV_Create_Membership__e + PlatformEvent + + Draft + + newMembership + SObject + false + false + false + Membership__c + + From 8d690e56bd79d86fcac661d898f038f57f82a112 Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Fri, 27 Sep 2024 16:47:15 -0400 Subject: [PATCH 2/3] new flow with updated recipient lookup mapped for membership --- .../flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml b/force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml index 55392d2..45f6a16 100644 --- a/force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml +++ b/force-app/main/default/flows/DPEV_Listener_Membership_Create_Flow.flow-meta.xml @@ -53,7 +53,7 @@ newMembership.Primary_Contact__c Assign - Query_Membership_Form_Submission.Contact__c + Query_Membership_Form_Submission.Recipient__c From e26863b3a1a17b2772d085560e9cf72564ba6e1e Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Thu, 24 Oct 2024 13:25:38 -0400 Subject: [PATCH 3/3] Retrieving changes because I got expiry notification Expiry Alert from Metecho Your Dev Org for "FLOW: Create Membership Create Data Processing Event Listener" on Membership Schema and Benefits Epic 2024 Sept Sprint is set to expire in 3 days on Oct. 27, 2024, 5:06 p.m.. You have uncommitted changes on your Org that will be deleted. If you do not want to lose these changes, please log into Metecho as user "jenncarneiro," navigate to the Task, and click the "Retrieve Changes from Dev Org" button. We appreciate your contribution to the Salesforce community. Thanks! --- ...sCloudMobile_UtilityBar.flexipage-meta.xml | 19 +++++++++++++++++++ .../Membership_Create_DPEV__e.object-meta.xml | 9 +++++++++ .../fields/Record_Id__c.field-meta.xml | 13 +++++++++++++ .../fields/Recipient__c.field-meta.xml | 13 +++++++++++++ .../listViews/All_Users.listView-meta.xml | 13 +++++++++++++ 5 files changed, 67 insertions(+) create mode 100644 force-app/main/default/flexipages/SalesCloudMobile_UtilityBar.flexipage-meta.xml create mode 100644 force-app/main/default/objects/Membership_Create_DPEV__e/Membership_Create_DPEV__e.object-meta.xml create mode 100644 force-app/main/default/objects/Membership_Create_DPEV__e/fields/Record_Id__c.field-meta.xml create mode 100644 force-app/main/default/objects/Membership_Form_Submission__c/fields/Recipient__c.field-meta.xml create mode 100644 force-app/main/default/objects/User/listViews/All_Users.listView-meta.xml diff --git a/force-app/main/default/flexipages/SalesCloudMobile_UtilityBar.flexipage-meta.xml b/force-app/main/default/flexipages/SalesCloudMobile_UtilityBar.flexipage-meta.xml new file mode 100644 index 0000000..9dcd275 --- /dev/null +++ b/force-app/main/default/flexipages/SalesCloudMobile_UtilityBar.flexipage-meta.xml @@ -0,0 +1,19 @@ + + + The default utility bar for the Sales Cloud Mobile application. + + + + runtime_sales_todo_list:unifiedToDoListAuraWrapper + runtime_sales_todo_list_unifiedToDoListAuraWrapper + + + utilityItems + Region + + Sales Cloud Mobile App Utility Bar + + UtilityBar + diff --git a/force-app/main/default/objects/Membership_Create_DPEV__e/Membership_Create_DPEV__e.object-meta.xml b/force-app/main/default/objects/Membership_Create_DPEV__e/Membership_Create_DPEV__e.object-meta.xml new file mode 100644 index 0000000..bc551c3 --- /dev/null +++ b/force-app/main/default/objects/Membership_Create_DPEV__e/Membership_Create_DPEV__e.object-meta.xml @@ -0,0 +1,9 @@ + + + Deployed + Membership Create - Description: DATA PROCESSING EVENT: Create a membership using data from a supplied record Id | Fields: Record Id (Text 20) + HighVolume + + Membership Create - DPEVs + PublishAfterCommit + diff --git a/force-app/main/default/objects/Membership_Create_DPEV__e/fields/Record_Id__c.field-meta.xml b/force-app/main/default/objects/Membership_Create_DPEV__e/fields/Record_Id__c.field-meta.xml new file mode 100644 index 0000000..3f4f1c7 --- /dev/null +++ b/force-app/main/default/objects/Membership_Create_DPEV__e/fields/Record_Id__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Record_Id__c + false + false + false + false + + 20 + true + Text + false + diff --git a/force-app/main/default/objects/Membership_Form_Submission__c/fields/Recipient__c.field-meta.xml b/force-app/main/default/objects/Membership_Form_Submission__c/fields/Recipient__c.field-meta.xml new file mode 100644 index 0000000..4e931ae --- /dev/null +++ b/force-app/main/default/objects/Membership_Form_Submission__c/fields/Recipient__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Recipient__c + SetNull + false + + Contact + Membership Form Submissions (Recipient) + Membership_Form_Submissions1 + false + false + Lookup + diff --git a/force-app/main/default/objects/User/listViews/All_Users.listView-meta.xml b/force-app/main/default/objects/User/listViews/All_Users.listView-meta.xml new file mode 100644 index 0000000..799a885 --- /dev/null +++ b/force-app/main/default/objects/User/listViews/All_Users.listView-meta.xml @@ -0,0 +1,13 @@ + + + All_Users + FULL_NAME + CORE.USERS.ALIAS + CORE.USERS.USERNAME + CORE.USER_ROLE.NAME + CORE.USERS.ACTIVE + CORE.PROFILE.NAME + Everything + + en_US +