b2c-crm-sync
b2c-crm-sync copied to clipboard
[BUG] ... Create the Order of Behalf Of Anonymous B2C Commerce Customer Profiles
Step 32 - when trying to run the line: npm run crm-sync:oobo:customers:create
I am getting the following error message:
{
"success": false,
"error": [
{
"stack": "TypeError: Cannot read property 'prototype' of undefined\n at Object.
I see that the account and contact records created on salesforce successfully. Can anyone please help me understand where this error is coming from ? And how can I overcome this ?
Thanks !
Your local environment details:
- Node version (
node -v
): v15.2.1 - NPM version (
npm -v
) 7.0.8 - SFDX version (
sfdx -v
) sfdx-cli/7.173.0 win32-x64 node-v16.17.1
Having the same issue...
{
"success": false,
"error": [
{
"stack": "TypeError: Cannot read property 'prototype' of undefined\n at Object.<anonymous> (/Users/osapishchuk/IdeaProjects/b2c-crm-sync/node_modules/@salesforce/plugin-data/lib/dataCommand.js:18:50)\n at Module._compile (node:internal/modules/cjs/loader:1102:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)\n at Module.load (node:internal/modules/cjs/loader:967:32)\n at Function.Module._load (node:internal/modules/cjs/loader:807:14)\n at Module.require (node:internal/modules/cjs/loader:991:19)\n at require (node:internal/modules/cjs/helpers:92:18)\n at Object.<anonymous> (/Users/osapishchuk/IdeaProjects/b2c-crm-sync/node_modules/@salesforce/plugin-data/lib/commands/force/data/record/get.js:13:23)\n at Module._compile (node:internal/modules/cjs/loader:1102:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)\n at Module.load (node:internal/modules/cjs/loader:967:32)\n at Function.Module._load (node:internal/modules/cjs/loader:807:14)\n at Module.require (node:internal/modules/cjs/loader:991:19)\n at require (node:internal/modules/cjs/helpers:92:18)\n at /Users/osapishchuk/IdeaProjects/b2c-crm-sync/node_modules/sfdx-node/index.js:86:21\n at Promise._execute (/Users/osapishchuk/IdeaProjects/b2c-crm-sync/node_modules/bluebird/js/release/debuggability.js:384:9)",
"message": "Cannot read property 'prototype' of undefined",
"name": "TypeError"
}
]
}
----------------------------------------------------------------------------
CRM-SYNC | v0.9.0 | crm-sync:oobo:customers:create: END
----------------------------------------------------------------------------
I am facing the same issue. @Verwest89 @olegforce were you able to resolve this problem?
In addition, customer that was created in BM is showing error "Cannot read property "AccountId" from null"
Having exactly the same issue.
Hello guys,
Just tried with a brand new installation, using:
- NodeJS v16.13.1
- NPM v8.1.2
- SFDX v7.162.0
- b2c-crm-sync v3.0.2
Working good as you can see:
jbachelet@jbachel-ltmkcll ~/D/G/S/b2c-crm-sync (develop)> npm run crm-sync:oobo:customers:create
> [email protected] crm-sync:oobo:customers:create
> node cli.js crm-sync:oobo:customers:create
----------------------------------------------------------------------------
CRM-SYNC | v0.9.0 | crm-sync:oobo:customers:create: START
----------------------------------------------------------------------------
-- Attempting to register the OOBO Customer Profiles for each storefront
┌──────────────────────────────┬──────────┬─────────────────────────────────────────────────────────────────────────────┐
│ Env. Property Name │ Is Valid │ Configured Property Value │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ b2cHostName │ true │ XXXX.dx.commercecloud.salesforce.com │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ b2cClientId │ true │ 25c65b97-XXXX-XXXX-XXXX-XXXX │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ b2cClientSecret │ true │ XXXXXXXXXXXX │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ b2cSiteIds │ true │ RefArch │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ sfHostName │ true │ velocity-XXXX-XXXX-dev-ed.scratch.my.salesforce.com │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ sfLoginUrl │ true │ test.salesforce.com │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ sfUsername │ true │ [email protected] │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ sfPassword │ true │ XXXXXXXX │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ sfSecurityToken │ true │ XXXXXXXXXXXX │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ b2cInstanceName │ true │ XXXX │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│ sfHostNameAlt │ true │ velocity-XXXX-XXXX-dev-ed.scratch.my.salesforce.com │
└──────────────────────────────┴──────────┴─────────────────────────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ B2C Commerce Authentication Token │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ eyJ0eXAiOiJKV1QiLCJraWQiOiJEMWhPUDdEODN4TjBqZWlqaTI3WWFvZFRjL0E9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIyNWM2NWI5Ny1lZTcxL… │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
-- Successfully verified the following B2C Commerce Storefronts
┌─────────────────────────┬──────────┬────────────────────┬─────────────────────────────────────────────────────────────┐
│ Site Identifier │ Status │ Storefront │ Site URL │
├─────────────────────────┼──────────┼────────────────────┼─────────────────────────────────────────────────────────────┤
│ RefArch │ 200 │ online │ /s/-/dw/data/v21_3/sites/RefArch │
└─────────────────────────┴──────────┴────────────────────┴─────────────────────────────────────────────────────────────┘
-- Verifying / creating the OOBO Anonymous Customer records for these B2C Storefronts
-- Could not verify the existence of an OOBO Anonymous Customer record; Creating a new customerProfile
┌──────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────┐
│ Customer Attribute │ Registration Value │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ customerList │ RefArch │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ customerNo │ 9999999 │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ customerId │ bcSavmuSrekMufiqjXRpcxoBKH │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ status │ OOBO Customer profile verified for this customerList / customerNo combination │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ creation date │ 2023-05-02T10:05:27.718Z │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ modified date │ 2023-05-02T10:05:29.502Z │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ login │ [email protected] │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ password │ --- │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ first name │ Anonymous │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ last name │ OOBO Customer │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ email │ [email protected] │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ accountId │ --- │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ contactId │ --- │
└──────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────┘
Getting Record...
Querying Data...
Updating Record...
Updating Record...
Updating Record...
Updating Record...
-- Verifying / updating the OOBO Anonymous Customer customerId values to sitePreferences for these sites
┌──────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────┐
│ Attribute │ Site Preference Value │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ customerListId │ RefArch │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ siteId │ RefArch │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ success │ true │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│ OOBOGuestCustomerId │ bcSavmuSrekMufiqjXRpcxoBKH │
└──────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────┘
----------------------------------------------------------------------------
CRM-SYNC | v0.9.0 | crm-sync:oobo:customers:create: END
----------------------------------------------------------------------------