Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Verwest89 opened this issue Nov 6, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Verwest89
Copy link

Verwest89 commented Nov 6, 2022

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:

  • 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
@Verwest89 Verwest89 added the bug Something isn't working label Nov 6, 2022
@olegforce
Copy link
Contributor

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
Copy link

elwira-zimoch commented Feb 8, 2023

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
Copy link

Having exactly the same issue.

@jbachelet
Copy link
Contributor

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

> 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
----------------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants