Hello,
I have been coding for decades - but I have no experience of APIs - so please fogive the basic level of this …
I have created some JS code that reads deal properties and calculates line item values based on them. It then creates these line items and associates them to the deal - all using hubspotClient.crm.lineItems.basicApi.create(LineInput);
I am not trying to update the deal Amount and a bespoke deal property (TenInstalmentCost). I have produced the code below:
__
let dealAmtUpdate = ‘’;
const tenPmtAmt = (TOTAL + 35.00)*0.107000222;
dealAmtUpdate = {
“id”: event.object.objectId,
“properties”: {
“amount”: TOTAL,
“TenInstalmentCost”: tenPmtAmt,
},
}
hubspotClient.crm.deals.basicApi.update(dealAmtUpdate);
__
The above code produces the error below. I am a bit lost as to what to do from here.
__
2024-02-17T12:28:18.726Z ERROR Unhandled Promise Rejection {“errorType”:“Runtime.UnhandledPromiseRejection”,“errorMessage”:“RequiredError: Required parameter simplePublicObjectInput was null or undefined when calling BasicApi.update.”,“reason”:{“errorType”:“RequiredError”,“errorMessage”:“Required parameter simplePublicObjectInput was null or undefined when calling BasicApi.update.”,“api”:“BasicApi”,“method”:“update”,“field”:“simplePublicObjectInput”,“name”:“RequiredError”,“stack”:[“RequiredError: Required parameter simplePublicObjectInput was null or undefined when calling BasicApi.update.”," at BasicApiRequestFactory.<anonymous> (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/deals/apis/BasicApi.js:153:23)“,” at Generator.next (<anonymous>)“,” at /opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/deals/apis/BasicApi.js:8:71"," at new Promise (<anonymous>)“,” at __awaiter (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/deals/apis/BasicApi.js:4:12)“,” at BasicApiRequestFactory.update (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/deals/apis/BasicApi.js:147:16)“,” at ObservableBasicApi.update (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/deals/types/ObservableAPI.js:74:59)“,” at PromiseBasicApi.update (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/deals/types/PromiseAPI.js:26:33)“,” at Object.exports.main (/var/task/file.js:198:34)“,” at Runtime.exports.hubspot_handler [as handler] (/var/task/hubspotHandler.js:7:21)“]},“promise”:{},“stack”:[“Runtime.UnhandledPromiseRejection: RequiredError: Required parameter simplePublicObjectInput was null or undefined when calling BasicApi.update.”,” at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)“,” at process.emit (node:events:513:28)“,” at emit (node:internal/process/promises:140:20)“,” at processPromiseRejections (node:internal/process/promises:274:27)“,” at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Unknown application error occurred
Runtime.Unknown