【发布时间】:2020-10-06 15:10:39
【问题描述】:
我有一个用于将供应商上传到 Acumatica 的 C# 应用程序。作为其中的一部分,我希望能够将 EFT 付款信息加载到付款设置页面上的付款说明中。看起来我应该在 API 中使用 BusinessAccountPaymentInstructionDetail,并且我尝试了各种方法但不能想办法。有没有人这样做并愿意分享代码示例?
我能够很好地创建供应商,然后返回并更新从供应商类填充的字段。付款方式和付款说明在 Acumatica 中设置,我正在尝试在创建时更新每个供应商的值。
这是我在创建后更新供应商的代码部分。它适用于 Checks,添加 Fedwire 是我遇到问题的地方。
//Create a Vendor record with the specified values
Vendor newVendor = (Vendor)client.Put(VendorToBeCreated);
Debug.WriteLine("*********** Vendor was created.");
//Update values on added vendor that defaulted from Vendor Class
//Cash Account
//Payment Method
//Payment Instructions for FEDWIRE
if (PaymentMethod == "CHECK")
{
newVendor.PaymentMethod.Value = PaymentMethod;
Debug.WriteLine("***********Cash Account and Payment Method Added*********");
}
else
{
if (PaymentMethod == "FEDWIRE")
{
Debug.WriteLine("***********FEDWIRE*********");
//This is where I am having issues trying to figure out what to pass in
newVendor.PaymentInstructions = new BusinessAccountPaymentInstructionDetail[]
{
new BusinessAccountPaymentInstructionDetail()
{
PaymentMethod = new StringValue { Value = PaymentMethod},
Description = new StringValue { Value = "Bank Name:"},
Value = new StringValue { Value = "123456"},
},
new BusinessAccountPaymentInstructionDetail()
{
PaymentMethod = new StringValue { Value = PaymentMethod },
Description = new StringValue { Value = "Bank Routing Number (ABA):" },
Value = new StringValue { Value = "267077627" },
},
new BusinessAccountPaymentInstructionDetail()
{
PaymentMethod = new StringValue { Value = PaymentMethod },
Description = new StringValue { Value = "Beneficiary Account No:" },
Value = new StringValue { Value = "987654321" },
},
new BusinessAccountPaymentInstructionDetail()
{
PaymentMethod = new StringValue { Value = PaymentMethod},
Description = new StringValue { Value = "Beneficiary Name:" },
Value = new StringValue { Value = "Jim" },
},
};
}
}
newVendor.CashAccount.Value = CashAccount;
client.Put(newVendor);
}
//End add Vendor
谢谢,
吉姆
【问题讨论】:
-
您需要提供最少的代码来重现问题。在此链接中查看有关如何发布问题的更多详细信息:stackoverflow.com/help/minimal-reproducible-example
标签: api soap acumatica vendor contract