Search code examples
acumatica

Acumatica - Updating User-Defined Field 'View' Error


I am trying to update a Custom Attribute on the Contact entity. Here is the structure for the request body (which works to update regular fields when 'custom' is not included):

{
  "ContactID": {
    "value" : {{record.ContactID.value}}
  },
  "custom" : {
      "Document": 
       { 
         "AttributeEXPORTEDMC" : 
           { 
             "type": "Checkbox", 
             "value": "True"
           }
       }
  }
}

Getting this error: 'An error has occurred.","exceptionMessage":"view Document is not found","exceptionType":"System.InvalidOperationException","stackTrace":" at PX.Api.ContractBased.EntityExportContextBuilder.EnsureCustomField(CustomField customField, String[] views)\r\n at System.Monads.MaybeIEnumerable.Do[TSource](IEnumerable`1 source,'.

The documentation saying that the view will always be 'Document' for user defined fields.

'For any user-defined field, the view name is Document'

Field/View Name Documentation

From: https://help-2020r1.acumatica.com/(W(28))/Help?ScreenId=ShowWiki&pageid=bd0d8a36-b00b-44c8-bdcd-b2b4e4c86fd0

[Update] Had to first create a UDF. Here is the working version for this case (v2 API):

{
  "ContactID": {
    "value": {{record.ContactID.value}}
  },
  "custom": {
    "Contact": {
      "AttributeEXPORTEDMC": {
        "type": "CustomBooleanField",
        "value": true
      }
    }
  }
}

Solution

  • You can add a UDF to the endpoint as such and modify it like any other field enter image description here