From f672af502e94a541d95559c1568ef136bbbe3a69 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 27 Aug 2024 15:58:46 -0500 Subject: [PATCH] add support for psychologicalStageChangeReason --- .../salesforce/update-or-create-contact-and-account.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/helpers/salesforce/update-or-create-contact-and-account.js b/api/helpers/salesforce/update-or-create-contact-and-account.js index cb07ada..210b556 100644 --- a/api/helpers/salesforce/update-or-create-contact-and-account.js +++ b/api/helpers/salesforce/update-or-create-contact-and-account.js @@ -29,6 +29,10 @@ module.exports = { '6 - Has team buy-in' ] }, + psychologicalStageChangeReason: { + type: 'string', + example: 'Website - Organic start flow' + }, leadSource: { type: 'string', isIn: [ @@ -54,7 +58,7 @@ module.exports = { }, - fn: async function ({emailAddress, linkedinUrl, firstName, lastName, organization, primaryBuyingSituation, psychologicalStage, leadSource}) { + fn: async function ({emailAddress, linkedinUrl, firstName, lastName, organization, primaryBuyingSituation, psychologicalStage, psychologicalStageChangeReason, leadSource}) { require('assert')(sails.config.custom.salesforceIntegrationUsername); require('assert')(sails.config.custom.salesforceIntegrationPasskey); @@ -90,6 +94,9 @@ module.exports = { if(psychologicalStage) { valuesToSet.Stage__c = psychologicalStage;// eslint-disable-line camelcase } + if(psychologicalStageChangeReason) { + valuesToSet.Psystage_change_reason__c = psychologicalStageChangeReason;// eslint-disable-line camelcase + } let existingContactRecord; // Search for an existing Contact record using the provided email address or linkedIn profile URL.