From ecbb7e27b6212a25d3579b7768ae2a390ad053ce Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Thu, 31 Jul 2025 11:31:16 -0400 Subject: [PATCH 1/5] Product2.Category__c picklist field added --- ...uct Layout for Memberships.layout-meta.xml | 4 ++ .../fields/Category__c.field-meta.xml | 46 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 force-app/main/default/objects/Product2/fields/Category__c.field-meta.xml diff --git a/force-app/main/default/layouts/Product2-Product Layout for Memberships.layout-meta.xml b/force-app/main/default/layouts/Product2-Product Layout for Memberships.layout-meta.xml index 0a593fd..7e2adcd 100644 --- a/force-app/main/default/layouts/Product2-Product Layout for Memberships.layout-meta.xml +++ b/force-app/main/default/layouts/Product2-Product Layout for Memberships.layout-meta.xml @@ -32,6 +32,10 @@ Edit Downgrade_Path__c + + Edit + Category__c + diff --git a/force-app/main/default/objects/Product2/fields/Category__c.field-meta.xml b/force-app/main/default/objects/Product2/fields/Category__c.field-meta.xml new file mode 100644 index 0000000..76c770e --- /dev/null +++ b/force-app/main/default/objects/Product2/fields/Category__c.field-meta.xml @@ -0,0 +1,46 @@ + + + Category__c + false + Category represents the type of product provided + + false + false + Picklist + + true + + false + + Access + false + + + + Services + false + + + + Resources + false + + + + Goods + false + + + + Engagement + false + + + + Special + false + + + + + From ab921a2854f39d6429afead1dc739e812c914f16 Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Thu, 31 Jul 2025 12:32:05 -0400 Subject: [PATCH 2/5] Updated the Membership Finder to locate a matching membership across a set of matching products (Same category); Updated to stamp that Finder Ran if a match is Not found. --- ...V_Listener_Membership_Finder.flow-meta.xml | 103 +++++++++++++++--- 1 file changed, 87 insertions(+), 16 deletions(-) diff --git a/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml b/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml index 9f73a07..01435e1 100644 --- a/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml +++ b/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml @@ -6,7 +6,7 @@ AssignMembershiptoOpportunityProduct 50 - 710 + 926 OpportunityProductforUpdate.Membership__c Assign @@ -40,7 +40,7 @@ SetMembershipFinderRanFlag 314 - 710 + 1226 OpportunityProductforUpdate.Membership_Finder_Ran__c Assign @@ -49,7 +49,7 @@ - Create_Membership_Essentials_Log_Pass1 + UpdateOpportunityLineItem @@ -57,7 +57,7 @@ MembershipPresent 314 - 602 + 818 Default Outcome Membership_Found @@ -85,7 +85,7 @@ - SetMembershipFinderRanFlag + Create_Membership_Essentials_Log_Pass1 @@ -123,9 +123,9 @@ Copy_2_of_Create_Membership_Essentials_Log_Pass 50 - 818 + 1034 - UpdateOpportunityLineItem + SetMembershipFinderRanFlag Flow_Name__c @@ -152,7 +152,7 @@ Create_GetMembership_Membership_Essentials_Log 1106 - 602 + 818 Flow_Name__c @@ -230,7 +230,7 @@ Create_Membership_Essentials_Log_Pass 314 - 1118 + 1442 Flow_Name__c @@ -256,9 +256,9 @@ Create_Membership_Essentials_Log_Pass1 314 - 818 + 926 - UpdateOpportunityLineItem + SetMembershipFinderRanFlag Flow_Name__c @@ -285,7 +285,7 @@ Create_UpdateOpportunityLineItem_Membership_Essentials_Log 842 - 1118 + 1442 Flow_Name__c @@ -308,11 +308,53 @@ true - Query for a Membership record where Account__c = Opportunity.AccountId where End_Date__c > today + Get_Matching_Products + + 314 + 494 + false + + Matching_Product_ID_List + + and + + IsActive + EqualTo + + true + + + + Category__c + EqualTo + + GetOpportunityProduct.Product2.Category__c + + + + Family + EqualTo + + Membership + + + + Renewal_Option__c + EqualTo + + Renewable + + + false + Product2 + true + + + Query for a Membership record where Account__c = Opportunity.AccountId where End_Date__c > today and the Product is a match; If more than one is found, uses the oldest record. GetMembership 314 - 494 + 710 false MembershipPresent @@ -335,9 +377,18 @@ FormulaToday + + Product__c + In + + Matching_Product_ID_List + + true Membership__c Id + CreatedDate + Asc true @@ -349,7 +400,7 @@ Return Opportunity.AccountId 386 false - GetMembership + Get_Matching_Products Create_GetOpportunity_Membership_Essentials_Log @@ -401,7 +452,7 @@ Return the Opportunity UpdateOpportunityLineItem 314 - 1010 + 1334 Create_Membership_Essentials_Log_Pass @@ -420,6 +471,26 @@ Return the Opportunity PlatformEvent Active + + Matching_Product_ID_List + + 314 + 602 + + GetMembership + + String + true + 0 + + + Map + + Get_Matching_Products[$EachItem].Id + + + + Variable to hold Opportunity Line item to be updated OpportunityProductforUpdate From ca523f592224d2c58b85e80783cc34920e68763c Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Thu, 31 Jul 2025 12:46:54 -0400 Subject: [PATCH 3/5] Updated decision criteria to continue if a membership value is populated and the membership finder has been run; --- .../BPEV_Listener_Membership_Transaction.flow-meta.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml b/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml index ea043b7..2343724 100644 --- a/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml +++ b/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml @@ -179,10 +179,10 @@ - Query_for_Opportunity_Line_Item.Membership_Finder_Ran__c + Get_New_Product_ID.Family EqualTo - false + Membership @@ -449,9 +449,6 @@ Id EqualTo - - $Record.Record_Id__c - true OpportunityLineItem From 8fcd38cf7b44690340181c414bc685794c4a1ef7 Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Thu, 31 Jul 2025 13:59:23 -0400 Subject: [PATCH 4/5] update the matching for existing memberships to look for similar products, not just ones with the same ID (same category) Flow updates included: BPEV_Listener_Membership_Transaction - reset to way it was this morning DPEV_Listener_Create_Opportunity- reset to way it was this morning DPEV_Listener_Membership_Finder - updates made DPEV_Listener_Membership_Upgrade- reset to way it was this morning --- ...tener_Membership_Transaction.flow-meta.xml | 7 +++-- ...V_Listener_Membership_Finder.flow-meta.xml | 31 +++++++++---------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml b/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml index 2343724..ea043b7 100644 --- a/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml +++ b/force-app/main/default/flows/BPEV_Listener_Membership_Transaction.flow-meta.xml @@ -179,10 +179,10 @@ - Get_New_Product_ID.Family + Query_for_Opportunity_Line_Item.Membership_Finder_Ran__c EqualTo - Membership + false @@ -449,6 +449,9 @@ Id EqualTo + + $Record.Record_Id__c + true OpportunityLineItem diff --git a/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml b/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml index 01435e1..4443ebc 100644 --- a/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml +++ b/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml @@ -40,7 +40,7 @@ SetMembershipFinderRanFlag 314 - 1226 + 926 OpportunityProductforUpdate.Membership_Finder_Ran__c Assign @@ -49,7 +49,7 @@ - UpdateOpportunityLineItem + Create_Membership_Essentials_Log_Pass1 @@ -85,7 +85,7 @@ - Create_Membership_Essentials_Log_Pass1 + SetMembershipFinderRanFlag @@ -125,7 +125,7 @@ 50 1034 - SetMembershipFinderRanFlag + UpdateOpportunityLineItem Flow_Name__c @@ -230,7 +230,7 @@ Create_Membership_Essentials_Log_Pass 314 - 1442 + 1334 Flow_Name__c @@ -256,9 +256,9 @@ Create_Membership_Essentials_Log_Pass1 314 - 926 + 1034 - SetMembershipFinderRanFlag + UpdateOpportunityLineItem Flow_Name__c @@ -285,7 +285,7 @@ Create_UpdateOpportunityLineItem_Membership_Essentials_Log 842 - 1442 + 1334 Flow_Name__c @@ -308,13 +308,14 @@ true + Get Active Renewable membership products that are a match for category. Tier will be compared later. Get_Matching_Products 314 494 false - Matching_Product_ID_List + Matching_Product_Id_List and @@ -350,7 +351,7 @@ true - Query for a Membership record where Account__c = Opportunity.AccountId where End_Date__c > today and the Product is a match; If more than one is found, uses the oldest record. + Query for a Membership record where Account__c = Opportunity.AccountId where End_Date__c > today GetMembership 314 @@ -381,14 +382,12 @@ Product__c In - Matching_Product_ID_List + Matching_Product_Id_List true Membership__c Id - CreatedDate - Asc true @@ -452,7 +451,7 @@ Return the Opportunity UpdateOpportunityLineItem 314 - 1334 + 1226 Create_Membership_Essentials_Log_Pass @@ -472,8 +471,8 @@ Return the Opportunity Active - Matching_Product_ID_List - + Matching_Product_Id_List + 314 602 From 0cc728f65af59e4601079ffceedbf04fd2234961 Mon Sep 17 00:00:00 2001 From: jenncarneiro Date: Thu, 31 Jul 2025 14:18:54 -0400 Subject: [PATCH 5/5] update the matching for existing memberships to look for similar products, not just ones with the same ID (same category) --- .../default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml b/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml index 4443ebc..2d1f47f 100644 --- a/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml +++ b/force-app/main/default/flows/DPEV_Listener_Membership_Finder.flow-meta.xml @@ -90,7 +90,7 @@ - Find membership associated with Opportunity Line Item and Account or mark Membership Form Submission Record to indicate that the finder ran. + Find existing membership associated with Opportunity Line Item and Account or mark Membership Form Submission Record to indicate that the finder ran. Default Returns today's date