通过Web服务API在Acumatica ERP的AP302000屏幕中插入调整文档 [英] Insert adjustments document in screen AP302000 of acumatica erp through web services api

查看:70
本文介绍了通过Web服务API在Acumatica ERP的AP302000屏幕中插入调整文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在屏幕支票和付款(AP302000)的申请文件中插入裁决文件(票据doc)。需要根据当前预付款凭证插入此调整凭证。我需要这样做以抵消特别的账单的预付款。注意:预付款和账单这两个文档在上一届会议中已经发布。因此,我只需要在标题中调用预付款单据的特殊参考nbr,然后在要申请的文档(详细交易)中调用比尔doc的特殊参考nbr。



请请参阅下面的屏幕截图。





有有人知道要解决此问题吗?

解决方案

在屏幕上在参考编号前带有类型选择器的用户,您必须添加其他操作,插入操作。



页面的结构似乎也存在问题,并且它会在输入每个字段后尝试在详细信息级别上进行更改。因此,由于还没有所有必需的信息来使它有效,因此返回您所看到的错误。



这里是一个应该起作用的代码示例:

  context.CookieContainer = new System.Net.CookieContainer(); 
context.Timeout = System.Threading.Timeout.Infinite;
context.Url = http:// localhost / Demo610u05 /(W(346))/Soap/AP302000.asmx;
LoginResult结果= context.Login( admin @ Company, admin);
AP302000Content checkSchema = context.AP302000GetSchema();

var detailTypeNoCommit = checkSchema.DocumentsToApply.DocumentType;
detailTypeNoCommit.Commit = false;
var detailRefNbrNoCommit = checkSchema.DocumentsToApply.ReferenceNbrAdjdRefNbr;
detailRefNbrNoCommit.Commit = false;
var detailamountPaidNoCommit = checkSchema.DocumentsToApply.AmountPaid;
detailamountPaidNoCommit.Commit = false;

List< Command> cmds = new List< Command>();
cmds.Add(新值{LinkedCommand = checkSchema.PaymentSummary.Type,值=预付款});
cmds.Add(checkSchema.Actions.Insert);
cmds.Add(新值{LinkedCommand = checkSchema.PaymentSummary.ReferenceNbr,Value = 1600001331});
cmds.Add(checkSchema.DocumentsToApply.ServiceCommands.NewRow);
cmds.Add(新值{LinkedCommand = detailTypeNoCommit,值= Bill});
cmds.Add(新值{LinkedCommand = detailRefNbrNoCommit,值= 1600003050});
cmds.Add(新值{LinkedCommand = detailamountPaidNoCommit,值= 80000});
try
{
cmds.Add(checkSchema.Actions.Save);
var结果= context.AP302000Submit(cmds.ToArray());
}
catch(异常例外)
{
MessageBox.Show(ex.Message);
}
最终
{
context.Logout();
}


I need to insert adjusment document (bill doc) in Documents to Apply of the screen Checks and Payments (AP302000). This adjustment document need to insert based on current "Prepayment" document. I need to do this for set off the "prepayment" with the spesific "bill". Note: both of this "Prepayment" and "Bill" documents already released in previous session. So I just have to call spesific reference nbr of Prepayment Doc in header, and then call the spesific Reference Nbr of Bill Doc in Documents to Apply (detail transaction).

Please refer to this screenshot below.

I tried to provide my goal using this code below.

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();
}

But when I debug this code, I got this error message. Please refer to this screenshot below.

Does anyone knows to solve this issue ?

解决方案

On Screen with a type selector before the reference number, you must add an additional action, the insert action.

Also there seem to be an issue with how the page is structured and it is trying to commit the change on the detail level after each and every field entered. So since it doesn't have yet all the required information for it to be valid it return the error you are seeing.

Here is a code sample that should work:

context.CookieContainer = new System.Net.CookieContainer();
context.Timeout = System.Threading.Timeout.Infinite;
context.Url = "http://localhost/Demo610u05/(W(346))/Soap/AP302000.asmx";
LoginResult result = context.Login("admin@Company", "admin");
AP302000Content checkSchema = context.AP302000GetSchema();

var detailTypeNoCommit = checkSchema.DocumentsToApply.DocumentType;
detailTypeNoCommit.Commit = false;
var detailRefNbrNoCommit = checkSchema.DocumentsToApply.ReferenceNbrAdjdRefNbr;
detailRefNbrNoCommit.Commit = false;
var detailamountPaidNoCommit = checkSchema.DocumentsToApply.AmountPaid;
detailamountPaidNoCommit.Commit = false;

List<Command> cmds = new List<Command>();
cmds.Add(new Value { LinkedCommand = checkSchema.PaymentSummary.Type, Value = "Prepayment" });
cmds.Add(checkSchema.Actions.Insert);
cmds.Add(new Value { LinkedCommand = checkSchema.PaymentSummary.ReferenceNbr, Value = "1600001331"});
cmds.Add(checkSchema.DocumentsToApply.ServiceCommands.NewRow);
cmds.Add(new Value { LinkedCommand = detailTypeNoCommit, Value = "Bill" });
cmds.Add(new Value { LinkedCommand = detailRefNbrNoCommit, Value = "1600003050"});
cmds.Add(new Value { LinkedCommand = detailamountPaidNoCommit, Value = "80000" });
try
{
   cmds.Add(checkSchema.Actions.Save);
   var result = context.AP302000Submit(cmds.ToArray());
}
catch (Exception ex)
{
       MessageBox.Show(ex.Message);
}
finally
{
   context.Logout();
}

这篇关于通过Web服务API在Acumatica ERP的AP302000屏幕中插入调整文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆