From 01f875a94d193ba1e709bf6cfe31a3951f3af81a Mon Sep 17 00:00:00 2001 From: MC Naveen <8493007+mcnaveen@users.noreply.github.com> Date: Thu, 7 Sep 2023 12:37:37 +0530 Subject: [PATCH] feat(Salesforce Node): Add fax field to lead option (#7030) Closes: https://community.n8n.io/t/there-is-no-fax-field-in-the-saleforce-lead-cretion/29829 --- .../nodes/Salesforce/LeadDescription.ts | 30 +++++++++++++++++++ .../nodes/Salesforce/LeadInterface.ts | 2 ++ .../nodes/Salesforce/Salesforce.node.ts | 12 ++++++++ 3 files changed, 44 insertions(+) diff --git a/packages/nodes-base/nodes/Salesforce/LeadDescription.ts b/packages/nodes-base/nodes/Salesforce/LeadDescription.ts index b7a9fc8c4c4d2..4395a48b9ea0b 100644 --- a/packages/nodes-base/nodes/Salesforce/LeadDescription.ts +++ b/packages/nodes-base/nodes/Salesforce/LeadDescription.ts @@ -228,6 +228,13 @@ export const leadFields: INodeProperties[] = [ default: '', description: 'Email address for the lead', }, + { + displayName: 'Fax', + name: 'fax', + type: 'number', + default: '', + description: 'Fax number of the lead', + }, { displayName: 'First Name', name: 'firstname', @@ -243,6 +250,14 @@ export const leadFields: INodeProperties[] = [ description: 'Whether the lead doesn’t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.', }, + { + displayName: 'Has Opted Out of Fax', + name: 'hasOptedOutOfFax', + type: 'boolean', + default: false, + description: + 'Whether the lead doesn’t want to receive fax from Salesforce (true) or does (false). Label is Email Opt Out.', + }, { displayName: 'Industry', name: 'industry', @@ -497,6 +512,13 @@ export const leadFields: INodeProperties[] = [ default: '', description: 'Email address for the lead', }, + { + displayName: 'Fax', + name: 'fax', + type: 'number', + default: '', + description: 'Fax Number of the lead', + }, { displayName: 'First Name', name: 'firstname', @@ -512,6 +534,14 @@ export const leadFields: INodeProperties[] = [ description: 'Whether the lead doesn’t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out.', }, + { + displayName: 'Has Opted Out of Fax', + name: 'HasOptedOutOfFax', + type: 'boolean', + default: false, + description: + 'Whether the lead doesn’t want to receive fax from Salesforce (true) or does (false). Label is Fax Opt Out.', + }, { displayName: 'Industry', name: 'industry', diff --git a/packages/nodes-base/nodes/Salesforce/LeadInterface.ts b/packages/nodes-base/nodes/Salesforce/LeadInterface.ts index fca3e2be5da70..21881f1b9900e 100644 --- a/packages/nodes-base/nodes/Salesforce/LeadInterface.ts +++ b/packages/nodes-base/nodes/Salesforce/LeadInterface.ts @@ -3,6 +3,7 @@ export interface ILead { Company?: string; LastName?: string; Email?: string; + Fax?: number; City?: string; Phone?: string; State?: string; @@ -25,4 +26,5 @@ export interface ILead { NumberOfEmployees?: number; MobilePhone?: string; HasOptedOutOfEmail?: boolean; + HasOptedOutOfFax?: boolean; } diff --git a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts index 380bf0daac32b..168075b9c56e2 100644 --- a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts +++ b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts @@ -1084,6 +1084,9 @@ export class Salesforce implements INodeType { if (additionalFields.hasOptedOutOfEmail !== undefined) { body.HasOptedOutOfEmail = additionalFields.hasOptedOutOfEmail as boolean; } + if (additionalFields.hasOptedOutOfFax !== undefined) { + body.HasOptedOutOfFax = additionalFields.hasOptedOutOfFax as boolean; + } if (additionalFields.email !== undefined) { body.Email = additionalFields.email as string; } @@ -1123,6 +1126,9 @@ export class Salesforce implements INodeType { if (additionalFields.industry !== undefined) { body.Industry = additionalFields.industry as string; } + if (additionalFields.fax !== undefined) { + body.Fax = additionalFields.fax as number; + } if (additionalFields.firstname !== undefined) { body.FirstName = additionalFields.firstname as string; } @@ -1190,6 +1196,9 @@ export class Salesforce implements INodeType { if (updateFields.hasOptedOutOfEmail !== undefined) { body.HasOptedOutOfEmail = updateFields.hasOptedOutOfEmail as boolean; } + if (updateFields.hasOptedOutOfFax !== undefined) { + body.hasOptedOutOfFax = updateFields.hasOptedOutOfFax as boolean; + } if (updateFields.lastname !== undefined) { body.LastName = updateFields.lastname as string; } @@ -1238,6 +1247,9 @@ export class Salesforce implements INodeType { if (updateFields.firstname !== undefined) { body.FirstName = updateFields.firstname as string; } + if (updateFields.fax !== undefined) { + body.Fax = updateFields.fax as number; + } if (updateFields.leadSource !== undefined) { body.LeadSource = updateFields.leadSource as string; }