Create Custom Entity Record

This tutorial should help you create the first Custom Entity record. Before moving forward, make sure your Authentication works and you understand the Key Concepts of the Pipeliner API and make sure you know how to use API parameters

The Custom Entity allows user to work with a completely new type of entity in Pipeliner. You can create Custom Entity records and link them with other entities using Lookup fields.

Tutorial Assignment

  • Create Custom Entity record with the particular Entity Type

  • Link Custom Entity record to Opportunity using Lookup field

  • Filter existing Custom entity record by custom field

0. Required fields

1. Prepare Data

Owner_id

Load an id of the user with the default sales unit. This user will become the owner of the newly created Custom Entity Record.

{{baseUrl}}/entities/Clients?load-only=id,default_unit_id&filter[email]=john.doe@example.com
{
            "id": "00000000-0000-0000-0000-000000011a7d",
            "default_unit_id": "aba4a358-f3f8-4f55-b3ed-dd5cf589103b"
}

We don´t necessarily need to load the default unit id. If only owner_id is specified in the final request, Pipeliner will automatically create the opportunity with the default User´s sales unit. (See step 2. of this tutorial)

Type_id

Pull Custom Entity Types. Store the ID of the Custom Entity Type

{{baseUrl}}/entities/MyCustomEntityType
 
{
	"is_delete_protected": true,
	"has_draft": false,
	"id": "00000000-0000-0000-0000-000000000002",
	"is_deleted": false,
	"modified": "2023-09-20 07:08:32.528011+00:00",
	"created": "2023-09-11 08:38:36.498033+00:00",
	"form_edit": {
	},
	"form_edit_api": {
	},
	"is_readonly": false,
	"name": "Custom entity 1",
	"is_published": true,
	"revision": 4288,
	"entity_api_name": "MyCustomEntity"
},
{
	"is_delete_protected": false,
	"has_draft": false,
	"id": "018ad56d-879c-b0dd-3c3a-75c59ab97a23",
	"is_deleted": false,
	"modified": "2023-09-27 06:57:23.126262+00:00",
	"created": "2023-09-27 06:57:19.772625+00:00",
	"form_edit": "",
	"form_edit_api": {
	},
	"is_readonly": false,
	"name": "Custom entity 2",
	"is_published": true,
	"revision": 4461,
	"entity_api_name": "MyCustomEntity"
}

2. Create Custom Entity record

Let´s Take data from Step 1. and use them in the following request to create a Custom Entity record.

{
	"name": "Custom Entity Record 3",
	"owner_id": "00000000-0000-0000-0000-000000011a7d",
	"type_id": "018ad56d-879c-b0dd-3c3a-75c59ab97a23"
}

Success response

{
	"success": true,
	"data": {
		"is_delete_protected": false,
		"id": "018ad5a4-2ea8-75f0-e8cc-c6e54688b165",
		"modified": "2023-09-27 07:57:01.480723+00:00",
		"created": "2023-09-27 07:57:01.480781+00:00",
		"owner": "http://example.com",
		"type": "http://example.com",
		"unit": "http://example.com",
		"name": "Custom Entity Record 3",
		"owner_id": "00000000-0000-0000-0000-000000011a7d",
		"share_mode": 0,
		"table_name": "ce_custom_entity1n",
		"type_id": "018ad56d-879c-b0dd-3c3a-75c59ab97a23",
		"unit_id": "7d9467e0-d885-4729-877e-5c9e1e057b4a",
		"is_deleted": false,
		"sharing_units": [],
		"sharing_clients": [],
		"documents": [],
		"is_favorite": false,
		"revision": 4464,
		"cf_high_priority": true,
		"cf_lookup_ce_mycustomentity_leadoppty": []
	}
}

Take data from Step 2. and use them in the following request, to link existing record to Opportunity using a Lookup field.

Get Opportunity_id

We are going to search for Opportunity by name. But you can use whatever parameter.

{{baseUrl}}/entities/Opportunities?filter-op[name]=contains&filter[name]=Accounting
{
        "is_delete_protected": false,
        "id": "0188d953-0aa6-1094-f764-1ce141993b26",
        "is_deleted": false,
        "modified": "2023-06-20 15:01:18.162394+00:00",
        "created": "2023-06-20 15:01:18.118462+00:00",
        "active_quote": null,
        "oppty_type": "http://example.com",
        "owner": "http://example.com",
        "product_currency": "http://example.com",
        "product_price_list": null,
        "reason_of_close": null,
        "step": "http://example.com",
        "unit": "http://example.com",
        "active_quote_id": null,
        "closing_date": "2023-06-21",
        "description": "",
        "is_archived": false,
        "is_value_auto_calculate": false,
        "label_flag": 0,
        "name": "Double Entry Accounting Services",
        "oppty_type_id": "0c03f112-4544-06a8-b162-1f14524c149c",
        "owner_id": "00000000-0000-0000-0000-000000011a7d",
        "product_currency_id": "c4ca4238-a0b9-0382-0dcc-509a6f75849b",
        "ranking": 50,
        "reason_of_close_description": "",
        "reason_of_close_id": null,
        "share_mode": 0,
        "step_id": "5854307d-d86e-4b97-be3f-a2c19f85ff07",
        "table_name": "oppty",
        "unit_id": "7d9467e0-d885-4729-877e-5c9e1e057b4a",
        "was_qualified": false,
        "revision": 3584,
        "value": {
        "base_value": 10000,
        "currency_id": "36665823-00d8-401f-b7d2-8e0736c3beb2",
        "value_foreign": 12500
        },
        "oppty_recurrence": null,
        "revenue_schedule": null,
        "product_relations": [],
        "primary_contact": null,
        "primary_account": "http://example.com",
        "contact_relations": [],
        "account_relations": [
                "http://example.com"
        ],
        "documents": [],
        "quote_relations": [],
        "status": 1,
        "qualify_date": null,
        "won_date": null,
        "lost_date": null,
        "days_in_step": 68,
        "is_favorite": false,
        "sharing_units": [],
        "sharing_clients": [],
        "tags": [],
        "formatted_name": "Double Entry Accounting Services",
        "modified_by_user": null
}

Create a linking between Custom Entity record and Opportunity

{
	"cf_lookup_ce_mycustomentity_leadoppty": "0188d953-0aa6-1094-f764-1ce141993b26"
}

Success response

{
		"is_delete_protected": false,
		"id": "018ad5a4-2ea8-75f0-e8cc-c6e54688b165",
		"modified": "2023-09-27 07:57:01.480723+00:00",
		"created": "2023-09-27 07:57:01.480781+00:00",
		"owner": "http://example.com",
		"type": "http://example.com",
		"unit": "http://example.com",
		"name": "Custom Entity Record 3",
		"owner_id": "00000000-0000-0000-0000-000000011a7d",
		"share_mode": 0,
		"table_name": "ce_custom_entity1n",
		"type_id": "018ad56d-879c-b0dd-3c3a-75c59ab97a23",
		"unit_id": "7d9467e0-d885-4729-877e-5c9e1e057b4a",
		"is_deleted": false,
		"sharing_units": [],
		"sharing_clients": [],
		"documents": [],
		"is_favorite": false,
		"revision": 4464,
		"cf_priority": 2,
		"cf_lookup_ce_mycustomentity_leadoppty": [
				"id": "0188d953-0aa6-1094-f764-1ce141993b26",
				"name": "Double Entry Accounting Services",
				"picture_url": null,
				"entity_name": "Opportunity",
				"entity_api_name": null,
				"entity_type_id": null,
				"is_deleted": false,
				"is_available": true
		]
}

4. Filter existing Custom Entity record by custom field

Filter Custom Entity records using the specific conditions.

{{baseUrl}}/entities/MyCustomEntity?filter-op[cf_priority]=gt&filter[cf_priority]=3

Success response

{
		"is_delete_protected": false,
		"id": "012bc5a7-23e8-15a0-a51b-e6c5462eb415",
		"modified": "2023-09-27 07:32:01.480723+00:00",
		"created": "2023-09-27 07:32:01.480781+00:00",
		"owner": "http://example.com",
		"type": "http://example.com",
		"unit": "http://example.com",
		"name": "Custom Entity Record 1",
		"owner_id": "00000000-0000-0000-0000-000000011a7d",
		"share_mode": 0,
		"table_name": "ce_custom_entity1n",
		"type_id": "018ad56d-879c-b0dd-3c3a-75c59ab97a23",
		"unit_id": "7d9467e0-d885-4729-877e-5c9e1e057b4a",
		"is_deleted": false,
		"sharing_units": [],
		"sharing_clients": [],
		"documents": [],
		"is_favorite": false,
		"revision": 4364,
		"cf_priority": 4,
		"cf_lookup_ce_mycustomentity_leadoppty": []
}

Last updated