我需要在文檔中插入調整文檔(bill doc)以應用屏幕支票和付款(AP302000)。該調整文件需要根據當前的「預付」文件來插入。我需要這樣做才能用特別的「賬單」來抵消「預付款」。注意:這個「預付款」和「賬單」文件都已在上一次會議中發佈。因此,我只需在頭文件中調用Prepayment Doc的特定參考號,然後在要應用的憑證(詳細交易)中調用Bill Doc的特定參考號。通過web服務API在acumatica erp的屏幕AP302000中插入調整文檔
請參考下面的截圖。
我試過下面使用此代碼提供我的目標。
context.CookieContainer = new System.Net.CookieContainer();
context.Timeout = System.Threading.Timeout.Infinite;
context.Url = "http://localhost/AcuInterface/(W(3))/Soap/SOD.asmx";
LoginResult result = context.Login("admin", "123");
AP302000Content checkSchema = context.AP302000GetSchema();
List<Command> cmds = new List<Command>();
cmds.Add(new Value { LinkedCommand = checkSchema.PaymentSummary.Type, Value = "Prepayment" });
cmds.Add(new Value { LinkedCommand = checkSchema.PaymentSummary.ReferenceNbr, Value = "1600001331"});
cmds.Add(checkSchema.DocumentsToApply.ServiceCommands.NewRow);
cmds.Add(new Value { LinkedCommand = checkSchema.DocumentsToApply.DocumentType, Value = "Bill" });
cmds.Add(new Value { LinkedCommand = checkSchema.DocumentsToApply.ReferenceNbrAdjdRefNbr, Value = "1600003050"});
cmds.Add(new Value { LinkedCommand = checkSchema.DocumentsToApply.AmountPaid, Value = "80000" });
try
{
cmds.Add(checkSchema.Actions.Save);
var result = context.AP302000Submit(cmds.ToArray());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
context.Logout();
}
但是,當我調試此代碼時,我收到此錯誤消息。請參考下面的截圖。
有誰知道解決這個問題?
嘗試設置'了'PaymentSummary'支付Amount'保存之前 –
我已經嘗試過了,我說這句法:cmds.Add(新價值{LinkedCommand = checkSchema.PaymentSummary.PaymentAmount,Value =「80000」});我仍然得到相同的錯誤.. – HariEko