I am always getting error like " unable to access basicApi of undefined". Can anyone hellp to provide solution to read custom objects in Serverless function.
Note: Same code is working fine in Custm code action
ERROR Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"TypeError: Cannot read property 'getById' of undefined","reason":{"errorType":"TypeError","errorMessage":"Cannot read property 'getById' of undefined","stack":["TypeError: Cannot read property 'getById' of undefined"," at Object.exports.main (/var/task/file.js:15:49)"," at Runtime.exports.hubspot_handler [as handler] (/var/task/hubspotHandler.js:6:21)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: TypeError: Cannot read property 'getById' of undefined"," at process.<anonymous> (/var/runtime/index.js:35:15)"," at process.emit (events.js:314:20)"," at processPromiseRejections (internal/process/promises.js:209:33)"," at processTicksAndRejections (internal/process/task_queues.js:98:32)"]}
Apr 28, 20224:06 AM - edited Apr 28, 20224:32 AM
Member
Accessing custom object in Serverless function
SOLVE
@SJaeger It is working fine with the approach you have mentioned above (index.js working fine in nodemon env). But if I paste the code in Design manager and try to execute the endpoint via Postman it thorws error " Execution Time: 722msRuntime.UnhandledPromiseRejection: TypeError: Cannot read property 'basicApi' of undefined". Kindly help me