Custom Fields and Codes

Support for custom fields was added in version 2.0 of the REST API.
They behave exactly like the standard entity fields and can be accessed or updated using the same mechanisms.

All activated custom fields appear in the metadata document.

⚠️ Important:
Whenever a custom field is activated or deactivated in the PROLIN Smart Client Administration Console,
you must restart either the Web module or the entire PROLIN Power Server instance for the changes to take effect.


Custom Codes

Support for custom codes was introduced in version 2.2 of the REST API.
These behave like standard code fields: a custom code field is a PROLIN.Web.OData.Model.Code property with a Text and a Value.

This covers both kinds of custom code field:

  • fields on the standard custom codes that Service Desk provides (for example ServicecallCode1), and
  • fields on custom codes you create yourself in the Service Desk or PROLIN Smart Client administration, ordered or hierarchical.

The Codes endpoint lists the codes of either kind, for example Codes?type=PriorState. A newly created custom code type follows the same rule as a custom field: it appears after the restart described above.


Usage

Custom code fields are declared in the metadata document, so the @odata.type annotation is optional. If you include it, the type is always:

"#PROLIN.Web.OData.Model.Code"

Custom codes can be used in POST and PATCH operations, and in $filter on their Value, for example $filter=PriorState2/Value eq 281540198073498.


Example: Updating Custom Codes

PATCH http://myserver:5181/odata/ServiceRequests(139239)  HTTP/1.1
Content-Length: 48
Content-Type: application/json
{
  "ServicecallCode1": {
    "@odata.type": "#PROLIN.Web.OData.Model.Code",
    "Text": "None"
  },
  "ServicecallCode2": {
    "@odata.type": "#PROLIN.Web.OData.Model.Code",
    "Value": 3120234513,
    "Text": "Waiting"
  },
  "ServicecallCode3": {
    "@odata.type": "#PROLIN.Web.OData.Model.Code",
    "Value": 3094610021
  }
}

✅ Key Points

Concept Description
@odata.type Optional; when given, #PROLIN.Web.OData.Model.Code.
Field behavior Same as standard fields once activated.
Restart required Power Server or Web module must restart after custom field configuration changes.
Operations supported Custom codes work in POST, PATCH, and GET requests, and in $filter on Value.
Created custom codes Fields on custom code types created in Service Desk work the same way as standard custom codes.

💡 Tip:
Custom codes are treated as dynamic properties.
Identify a code by its Value, which the Codes endpoint lists.

Back to top