SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
65 stars 45 forks source link

[BUG] ... Create the Order of Behalf Of Anonymous B2C Commerce Customer Profiles #207

Open Verwest89 opened 1 year ago

Verwest89 commented 1 year ago

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. (...\Desktop\VS Projects\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. (...\Desktop\VS Projects\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 ...\Desktop\VS Projects\b2c-crm-sync\node_modules\sfdx-node\index.js:86:21\n at Promise._execute (...\Desktop\VS Projects\b2c-crm-sync\node_modules\bluebird\js\release\debuggability.js:384:9)", "message": "Cannot read property 'prototype' of undefined", "name": "TypeError" } ] }

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:

olegforce commented 1 year ago

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
----------------------------------------------------------------------------
elwira-zimoch commented 1 year ago

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"

hespigares commented 1 year ago

Having exactly the same issue.

jbachelet commented 1 year ago

Hello guys,

Just tried with a brand new installation, using:

Working good as you can see:

jbachelet@jbachel-ltmkcll ~/D/G/S/b2c-crm-sync (develop)> npm run crm-sync:oobo:customers:create

> b2c-crm-sync@3.0.2 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   │ test-XXXX@example.com                                               │
├──────────────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────┤
│                   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 │ oobo-kecorzas@crmsync.salesforce.com                                                   │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│                     password │ ---                                                                                    │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│                   first name │ Anonymous                                                                              │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│                    last name │ OOBO Customer                                                                          │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│                        email │ oobo-kecorzas@crmsync.salesforce.com                                                   │
├──────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│                    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
----------------------------------------------------------------------------