Hi,
We’ve been trying to find how to get a specific data from the API & SDK.
We have a Custom Object with its own Pipeline (not the standard Deals pipeline).
This object flow has several Stages, and we must retrieve an object current stage from the Pipeline. We have the object’s ID, pipeline ID, and desired stage ID.
Any one of the following solutions would help, but we’re unable to retrieve any from the API or NodeJS SDK:
- Retrieve all custom objects under a pipeline stage;
- Given a custom object ID and Pipeline ID, retrieve its current stage;
- Retrieve all custom object history, so we can search for “moved to stage” events and figure where it is currently.
Hi Fernando,
Looks like you will need to download all the Custom Objects and check each one. There are limited search parameters available even if you have an enterprise portal.
I would get batches of objects (specifying only the properties you need for all 3 queries) and walk the arry of objects returned. We typically use a recursive function if there arent too many objects (e.g. thousands).
Have fun
Mike
We got it with a few steps.
First we had to retrive the complete schema for our object (which we were already doing):
const schema = await this.client.crm.schemas.coreApi.getById(custom_obj_id);
This gets us most of properties but not all, we had to ask for the stage:
schema.props.push('hs_pipeline_stage');
After that retrieving works:
const card = await this.client.crm.objects.basicApi.getById(custom_obj_id, card_id, schema.props, ['contacts']);