From 468ed23f73fa0c7b7ba7cf5271cc109549e52fa6 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 27 May 2026 14:18:31 -0700 Subject: [PATCH] IO-3722 Fix undefined customer ref. --- server/fortellis/fortellis.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/fortellis/fortellis.js b/server/fortellis/fortellis.js index c69531518..75e419824 100644 --- a/server/fortellis/fortellis.js +++ b/server/fortellis/fortellis.js @@ -226,8 +226,8 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome return; } //Bypass only the customer creation. We still need to create the vehicle and update it to post the service history later on. + let DMSCust; if (!JobData.bodyshop.cdk_configuration.disablecontact) { - let DMSCust; if (selectedCustomerId) { CreateFortellisLogEvent(socket, "DEBUG", `{3.1} Querying the Customer using Customer ID: ${selectedCustomerId}`); @@ -257,6 +257,8 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome defaultFortellisTTL ); } + }else{ + DMSCust = { customerId: bypassCustomerId }; } let DMSVeh; @@ -916,7 +918,7 @@ async function InsertDmsVehicle({ socket, redisHelpers, JobData, txEnvelope, DMS // "wheelbase": "" }, // Owners is not required. Exclude it if we are bypassing. - ...(selectedCustomerId !== bypassCustomerId && { + ...(DMSCust?.customerId !== bypassCustomerId && { owners: [ { id: {