I'm using the Acumatica RESTClient and Acumatica Default_22.200.001 libraries in building an API interface. I'm connecting to the Default endpoint. The Purchase Order screen has a User Defined Field based off an Attribute.
I am able to create the PO however the UDF field is not updated. The Custom field in the generated JSON request is only showing the Type but not the Value of the attribute. Below are some code snippets:
public class CustomStringField : Acumatica.RESTClient.ContractBasedApi.Model.CustomField
{
public string Value { get; set; }
}
Acumatica.RESTClient.ContractBasedApi.Model.CustomStringField customStringField = new Acumatica.RESTClient.ContractBasedApi.Model.CustomStringField()
{
viewName = "Document",
fieldName = "AttributeESTPONBR",
Type = "CustomStringField",
Value = "E123"
};
PurchaseOrder order = new PurchaseOrder()
{
Type = "Normal",
Date = poDate,
PromisedOn = estDelDate,
VendorID = vendor.VendorID,
VendorRef = vQuote,
Description = notes,
Note = splInstr,
Custom = new Dictionary<string, Dictionary<string, Acumatica.RESTClient.ContractBasedApi.Model.CustomField>>
{
{
"Document", new Dictionary<string, Acumatica.RESTClient.ContractBasedApi.Model.CustomField>
{
{"AttributeESTPONBR", customStringField }
}
}
},
Details = details
};
Yet, my generated JSON request does not show the value for the attribute. What am I doing incorrect? Or is it not possible to update a custom UDF via API without extending the endpoint? Appreciate any help.
Body: {"Date":{"value":"2024-03-15T00:00:00"},"Description":{"value":"test"},"Details":[{"InventoryID":{"value":"ARCHITECTURAL DOORS"},"OrderQty":{"value":10.0},"UnitCost":{"value":325.0},"UOM":{"value":"EACH"}}],"PromisedOn":{"value":"2024-03-15T00:00:00"},"Type":{"value":"Normal"},"VendorID":{"value":"DOUMOC"},"VendorRef":{"value":"r456"},"custom":{"Document":{"AttributeESTPONBR":{"Type":"CustomStringField"}}},"note":{"value":"test"}}