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

Upsert with AlternateKey causes "TypeError: Cannot read property '1' of null"error #41

Closed
elberfeld opened this issue Jan 15, 2019 · 1 comment
Assignees
Labels

Comments

@elberfeld
Copy link

The following sample works but causes an error.

When using a Guid instead everything works fine.
When setting "return=representation" Prefer Header the error also does not occur"
Tested with Dynamics webAPI 90 and 9.1

Code:

dynamicsWebApi.upsert("ad_key_str='0037'", "ad_akademischertitels", titel_update).then(function () {
console.log("Titel Upserted");
})
.catch(function (error) {
console.log(error.message);
});

Error:

TypeError: Cannot read property '1' of null
parseResponse.js:207
at parseResponse (d:[...]\node_modules\dynamics-web-api\lib\requests\helpers\parseResponse.js:207:102)
at IncomingMessage. (d:[...]\node_modules\dynamics-web-api\lib\requests\http.js:57:40)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

List of npm Modules:

+-- adal-node@0.1.28
| +-- @types/node@8.10.39
| +-- async@2.6.1
| | -- lodash@4.17.11 | +-- date-utils@1.2.21 | +-- jws@3.1.5 | | +-- jwa@1.1.6 | | | +-- buffer-equal-constant-time@1.0.1 | | | +-- ecdsa-sig-formatter@1.0.10 | | | | -- safe-buffer@5.1.2 deduped
| | | -- safe-buffer@5.1.2 deduped | | -- safe-buffer@5.1.2
| +-- request@2.88.0
| | +-- aws-sign2@0.7.0
| | +-- aws4@1.8.0
| | +-- caseless@0.12.0
| | +-- combined-stream@1.0.7
| | | -- delayed-stream@1.0.0 | | +-- extend@3.0.2 | | +-- forever-agent@0.6.1 | | +-- form-data@2.3.3 | | | +-- asynckit@0.4.0 | | | +-- combined-stream@1.0.7 deduped | | | -- mime-types@2.1.21 deduped
| | +-- har-validator@5.1.3
| | | +-- ajv@6.7.0
| | | | +-- fast-deep-equal@2.0.1
| | | | +-- fast-json-stable-stringify@2.0.0
| | | | +-- json-schema-traverse@0.4.1
| | | | -- uri-js@4.2.2 | | | | -- punycode@2.1.1
| | | -- har-schema@2.0.0 | | +-- http-signature@1.2.0 | | | +-- assert-plus@1.0.0 | | | +-- jsprim@1.4.1 | | | | +-- assert-plus@1.0.0 deduped | | | | +-- extsprintf@1.3.0 | | | | +-- json-schema@0.2.3 | | | | -- verror@1.10.0
| | | | +-- assert-plus@1.0.0 deduped
| | | | +-- core-util-is@1.0.2
| | | | -- extsprintf@1.3.0 deduped | | | -- sshpk@1.16.0
| | | +-- asn1@0.2.4
| | | | -- safer-buffer@2.1.2 deduped | | | +-- assert-plus@1.0.0 deduped | | | +-- bcrypt-pbkdf@1.0.2 | | | | -- tweetnacl@0.14.5 deduped
| | | +-- dashdash@1.14.1
| | | | -- assert-plus@1.0.0 deduped | | | +-- ecc-jsbn@0.1.2 | | | | +-- jsbn@0.1.1 deduped | | | | -- safer-buffer@2.1.2 deduped
| | | +-- getpass@0.1.7
| | | | -- assert-plus@1.0.0 deduped | | | +-- jsbn@0.1.1 | | | +-- safer-buffer@2.1.2 | | | -- tweetnacl@0.14.5
| | +-- is-typedarray@1.0.0
| | +-- isstream@0.1.2
| | +-- json-stringify-safe@5.0.1
| | +-- mime-types@2.1.21
| | | -- mime-db@1.37.0 | | +-- oauth-sign@0.9.0 | | +-- performance-now@2.1.0 | | +-- qs@6.5.2 | | +-- safe-buffer@5.1.2 deduped | | +-- tough-cookie@2.4.3 | | | +-- psl@1.1.31 | | | -- punycode@1.4.1 extraneous
| | +-- tunnel-agent@0.6.0
| | | -- safe-buffer@5.1.2 deduped | | -- uuid@3.3.2 deduped
| +-- underscore@1.9.1
| +-- uuid@3.3.2
| +-- xmldom@0.1.27
| -- xpath.js@1.1.0 -- dynamics-web-api@1.5.0

@AleksandrRogov
Copy link
Owner

Hi @elberfeld ,
Thanks for reporting the issue. I'm going to replicate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants