$custom Parameter
When you retrieve records from MYOB Acumatica by using the contract-based REST API, you use the $custom parameter to specify the fields that are not defined in the contract of the endpoint to be returned from MYOB Acumatica. That is, you can use this parameter to obtain the values of the predefined elements on an MYOB Acumatica form that are not included in the entity definition, the values of user-defined fields, and the values of elements that were added to the MYOB Acumatica form in a customization project.
- If a top-level entity contains the custom field that corresponds to the element:
<View name>.<Field name>
, where you replace<View name>
with the name of the data view that contains the element and<Field name>
with the internal name of the element. - If a linked or detail entity contains the custom field that corresponds to the element:
<Entity name>/<View name>.<Field name>
, where you replace<Entity name>
with the name of the linked or detail entity that contains the field,<View name>
with the name of the data view that contains the element, and<Field name>
with the internal name of the element.Note: If you want to obtain the value of a custom field of a linked or detail entity, in addition to specifying the $custom parameter, you have to specify this entity in the $expand parameter. - If the element is a user-defined field:
<View name>.Attribute<AttributeID>
, where you replace<View name>
with the name of the data view that contains the element, and<AttributeID>
with the ID of the attribute that corresponds to the user-defined field.For details about user-defined fields, see User-Defined Fields.
If you want to obtain the values of multiple custom elements, you specify the custom elements to be returned, separated by commas. For details on how to find out the field name and the name of the data view, see Custom Fields.
Example: Custom Field of a Top-Level Entity
Suppose that in an extension of the Default/20.200.001 endpoint, you added the
RepairItemType
field to the top-level StockItem
entity. This
field corresponds to the Repair Item Type custom element that has been
added to General tab of the Stock Items
(IN202500) form. If you want to obtain the value of this element, you use the following
parameter string: $custom=ItemSettings.UsrRepairItemType.
Example: Custom Field of a Detail Entity
Suppose that in an extension of the Default/20.200.001 endpoint, you added the
RepairItemType
field to the SalesOrderDetail
detail entity.
This field corresponds to the Repair Item Type custom column, which has
been added to the Details tab of the Sales Orders (SO301000) form. If you want to obtain the value of this
element, you use the following parameter string:
$custom=Details/Transactions.UsrRepairItemType. You also use the $expand
parameter as follows: $expand=Details.
Example: User-Defined Field
Suppose that on the Sales Orders (SO301000) form, you have added a user-defined field for the OPERATSYST attribute. If you want to obtain the value of this user-defined field, you use the following parameter string: $custom=Document.AttributeOPERATSYST.