【发布时间】:2021-02-17 10:20:04
【问题描述】:
更新:--- 提供的代码修复了图表上阻止 API 允许我创建的问题。
public class CustomerPaymentMethodMaint_Extension:PXGraphExtension<CustomerPaymentMethodMaint>
{
#region Event Handlers
protected virtual void CustomerPaymentMethodDetail_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
{
if (del != null)
{
del(cache, e);
}
if (Base.IsContractBasedAPI)
{
CustomerPaymentMethodDetail row = (CustomerPaymentMethodDetail)e.Row;
PXDefaultAttribute.SetPersistingCheck<CustomerPaymentMethodDetail.value>(cache, row, PXPersistingCheck.Nothing);
}
}
#endregion
}
在我的一生中,我无法弄清楚 Acumatica 期望我向它发送什么以使用 Rest API 检索或创建客户付款方式。如果您能指出正确的方向,将不胜感激。我们给出的例子非常基础,似乎没有涵盖任何这样的场景。
我假设它将使用帮助部分中描述的标准“按关键字段检索记录”来检索。
我已尝试使用以下所有 url 结构,但它要么给我一个“由于对象的当前状态,操作不被重视”错误,要么是“多个实体满足条件”。
/entity/Default/6.00.001/CustomerPaymentMethod/{BAccountID}/{PMInstanceID}
/entity/Default/6.00.001/CustomerPaymentMethod/{AcctCD}/{PMInstanceID}
/entity/Default/6.00.001/CustomerPaymentMethod/{BAccountID}
/entity/Default/6.00.001/CustomerPaymentMethod/{PMInstanceID}
/entity/Default/6.00.001/CustomerPaymentMethod/{AcctCD}
在尝试创建付款方式时,我尝试使用带有以下 json 正文的 CustomerPaymentMethod 端点的“PUT”(我还尝试使用这些字段的肥皂友好名称而不是 UI“CCDNUM”中的标签, “CVV”、“EXPDATE”、“NAMEONCC”)。返回给我的错误是“值”不能为空。
{
"CustomerID" : { value: "0000467" },
"PaymentMethod" : { value: "CC" },
"CustomerPaymentMethodDetail" : [
{
"Description" : { value : "Card Number" },
"Value" : { value : "4111111111111111" },
},
{
"Description" : { value : "Expiration Date" },
"Value" : { value : "102020" },
},
{
"Description" : { value : "Name on the Card" },
"Value" : { value : "Test API" },
}
]
}
【问题讨论】:
-
您好 Chris,您如何使用 RestAPI 解决此问题?我收到同样的错误“PX.Data.PXException:错误:‘值’不能为空。”请指导我解决这个问题。快速帮助将不胜感激。提前谢谢你。
-
克里斯,如果您从 Acumatica 得到答案而不是提出问题,您应该回答自己的问题并接受答案。
标签: acumatica