I am working on using HubSpot Custom Code Workflow Actions to associate the deal in the workflow with a specific company (I already know the company ID).
For the property included in the code, I have the Deal ID as hs_object_id
I'm looking to get code to work to associate deals we're creating via API/Web forms to the correct companys (company IDs will be known as a deal property value). I've looked at multiple other community posts but non of the codes are quite right and erroring when trying to run them. any help would be appreciated!
Hi Louis, my colleague managed to get it working. it was using custom code on a deal workflow where the company ID value was present in a deal property.
We have an app called Associ8 that would solve your problem. No code required! It creates a workflow action that associates objects together based on your search parameters (the company ID and deal ID in your case). Check it out here.
Let me know if you have any questions or need help setting up. I'd be happy to hop on a call with you!
2023-07-12T14:11:54.028Z ERROR TypeError: Cannot read properties of undefined (reading 'makeRequestContext')
at AssociationsApiRequestFactory.<anonymous> (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/objects/apis/AssociationsApi.js:87:55)
at Generator.next (<anonymous>)
at /opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/objects/apis/AssociationsApi.js:8:71
at new Promise (<anonymous>)
at __awaiter (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/objects/apis/AssociationsApi.js:4:12)
at AssociationsApiRequestFactory.create (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/objects/apis/AssociationsApi.js:64:16)
at ObservableAssociationsApi.create (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/objects/types/ObservableAPI.js:29:59)
at PromiseAssociationsApi.create (/opt/nodejs/node_modules/@hubspot/api-client/lib/codegen/crm/objects/types/PromiseAPI.js:14:33)
at Object.exports.main (/var/task/file.js:7:44)
at Runtime.exports.hubspot_handler [as handler] (/var/task/hubspotHandler.js:6:21)
Memory: 72/128 MB
Runtime: 854.28 ms
Apologies, I'm not a developer and I can't really understand. Are you able to create a code (whether in Python or Node.jx as these are the only ones avaiable in Custom Code) to associate a deal with the primary company the contact is from. I've looked around for different codes and tried and none of them worked.
To activate the beta you need to click on Avatar (top right corner) > Product updates and search for "New Workflow Actions for Associations"
If it doesn't work for your use case, contact me through this form (https://www.auxilio.io/en/contact) and I'll send you a quote to develop a custom automation for you.
I also wanted to invite a couple of subject matter experts to this conversation @louischausse, @Teun and @HFisher7: do you have any tips to help @iingallslawtige to associate a deal to a specific company via a custom coded workflow action please?