我正在使用 Acumatica RESTClient 和 Acumatica Default_22.200.001 库来构建 API 接口。我正在连接到默认端点。采购订单屏幕有一个基于属性的用户定义字段。
我能够创建采购订单,但 UDF 字段未更新。生成的 JSON 请求中的自定义字段仅显示属性的类型,但不显示属性的值。以下是一些代码片段:
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
};
但是,我生成的 JSON 请求未显示该属性的值。我做错了什么?或者是否无法在不扩展端点的情况下通过 API 更新自定义 UDF?感谢任何帮助。
正文:{“日期”:{“值”:“2024-03-15T00:00:00”},“描述”:{“值”:“测试”},“详细信息”:[{“库存ID”: {"value":"建筑门"},"OrderQty":{"value":10.0},"UnitCost":{"value":325.0},"UOM":{"value":"EACH"}}] ,"PromisedOn":{"value":"2024-03-15T00:00:00"},"Type":{"value":"正常"},"VendorID":{"value":"DOUMOC"} ,"VendorRef":{"value":"r456"},"custom":{"Document":{"AttributeESTPONBR":{"Type":"CustomStringField"}}},"note":{"value ":"测试"}}
使用较新版本的 Acumatica RESTClient (v5.1) 后,此问题已得到解决。