Let the platform do the work

//customfield POST

Overview

Create a new custom field for a specified module.

Summary

This endpoint is used to create a new custom field for a specified module.

Request Arguments

Name Type Description Required
data array The field metadata. True

Request Examples

This example will create a decimal type custom field:

  {
    "localizations": {
      "en_us": {
          "LBL_AI_SCORE": "Ai Score"
      },
      ...
    },
    "data":{
      "name":"ai_score",
      "label":"LBL_AI_SCORE",
      "type":"decimal",
      "len":"18",
      "precision":8,
      "required":false,
      "reportable":false,
      "audited":false,
      "importable":false,
      "duplicate_merge":false
    }
}

This example will create a textField type custom field:

  {
    "localizations": {
      "en_us": {
          "LBL_AI_SCORE_DESC": "Ai Score Description"
      },
      ...
    },
    "data":{
      "name":"ai_score_desc",
      "label":"LBL_AI_SCORE_DESC",
      "type":"varchar",
      "help":"Text Field Help Text",
      "comments":"Text Field Comment Text",
      "default_value":"",
      "len":255,
      "required":false,
      "reportable":true,
      "audited":false,
      "importable":"true",
      "duplicate_merge":false
    }
}

This example will create an enum type custom field with a new dropdown list:

  {
    "localizations": {
      "en_us": {
          "LBL_DROPDOWN_FIELD": "New Dropdown Field",
          "LBL_DD_ITEM_ONE": "First Text",
          "LBL_DD_ITEM_TWO": "Second Text",
          "LBL_DD_ITEM_THREE": "Third Text"
      },
      ...
    },
    "data": {
      "name":"new_dropdown_field",
      "label":"LBL_DROPDOWN_FIELD",
      "type":"enum",
      "options": {
        "dropdownName": "a_new_dropdown",
        "dropdownList": [
          {"value":"First", "label":"LBL_DD_ITEM_ONE"},
          {"value":"Second", "label":"LBL_DD_ITEM_TWO"},
          {"value":"Third", "label":"LBL_DD_ITEM_THREE"}
        ]
      },
      "default_value":"First"
    }
}

This example will create an enum type custom field using an existing dropdown list:

  {
    "localizations": {
      "en_us": {
          "LBL_DROPDOWN_FIELD": "New Dropdown Field"
      },
      ...
    },
    "data": {
      "name":"new_dropdown_field",
      "label":"LBL_DROPDOWN_FIELD",
      "type":"enum",
      "options": "account_type_dom",
      "default_value":"Analyst"
    }
}

Response

  {
    "duplicate_merge_dom_value": 0,
    "required": false,
    "source": "custom_fields",
    "name": "ai_score_c",
    "vname": "LBL_AI_SCORE",
    "type": "decimal",
    "massupdate": false,
    "hidemassupdate": false,
    "no_default": false,
    "comments": "",
    "help": "",
    "importable": "",
    "duplicate_merge": "disabled",
    "audited": false,
    "reportable": false,
    "unified_search": false,
    "merge_filter": "disabled",
    "pii": false,
    "calculated": false,
    "len": 18,
    "size": "20",
    "enable_range_search": false,
    "precision": "8",
    "id": "ca9653de-0976-11eb-a558-6c400895ea84",
    "custom_module": "Opportunities"
}

Change Log

Version Change
v11.11 Added /<module>/customfield POST endpoint.