From b597dad450b7f00f3fd4f195678114836dcfc097 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Fri, 28 Mar 2025 07:24:03 -0400 Subject: [PATCH] feat: Salesforce - Fallback to Lead if Contact Isn't Found For Routing (#20423) * Add fallback to lead to schema * FE option to fallback to lead owner * Logic to query for contacts and leads for RR skip --- apps/web/public/static/locales/en/common.json | 1 + .../components/EventTypeAppCardInterface.tsx | 13 ++++++++ .../app-store/salesforce/lib/CrmService.ts | 30 +++++++++++++++++++ packages/app-store/salesforce/zod.ts | 1 + 4 files changed, 45 insertions(+) diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index 5b11fa8b6f..dfb4c49080 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -3044,5 +3044,6 @@ "could_not_find_slug_to_publish_org": "Could not find slug to publish the organization", "picklist": "Picklist", "name_or_email": "Name or Email", + "salesforce_round_robin_skip_fallback_to_lead_owner": "If no contact is found, fallback to lead owner if it exists", "ADD_NEW_STRINGS_ABOVE_THIS_LINE_TO_PREVENT_MERGE_CONFLICTS": "↑↑↑↑↑↑↑↑↑↑↑↑↑ Add your new strings above here ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑" } diff --git a/packages/app-store/salesforce/components/EventTypeAppCardInterface.tsx b/packages/app-store/salesforce/components/EventTypeAppCardInterface.tsx index 9f6dbcba8e..66f87819f2 100644 --- a/packages/app-store/salesforce/components/EventTypeAppCardInterface.tsx +++ b/packages/app-store/salesforce/components/EventTypeAppCardInterface.tsx @@ -46,6 +46,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ const onBookingWriteToRecord = getAppData("onBookingWriteToRecord") ?? false; const onBookingWriteToRecordFields = getAppData("onBookingWriteToRecordFields") ?? {}; const ignoreGuests = getAppData("ignoreGuests") ?? false; + const roundRobinSkipFallbackToLeadOwner = getAppData("roundRobinSkipFallbackToLeadOwner") ?? false; const { t } = useLocale(); @@ -522,6 +523,18 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ }} /> + {checkOwnerSelectedOption.value === SalesforceRecordEnum.CONTACT ? ( +