2017-04-07 25 views
3

这是第一种场景: - 我在acumatica系统中使用webservices api创建了Bill和Adjustments屏幕(AP301000)的新“账单”文档。 - 之后,我需要使用webservices加载当前屏幕(AP301000)的“应用程序”选项卡菜单中的所有文档记录以进行关闭处理。问题是有很多文件会被加载。它大约有9500份文件,当然需要更多次(大约10分钟)。如何在acumatica中使用webservices api导出数据时设置超时

我在导出过程中总是出现错误,此应用程序选项卡菜单中的所有记录。并且错误消息是“操作超时”。

是否有任何引用来设置通过webservices api的巨大文档的导出过程中的超时。

sCon.getLoginSettlementVoucher(context); 
AP301000Content billSchema2 = context.AP301000GetSchema(); 
List<Command> cmds = new List<Command>(); 
billSchema2.DocumentSummary.Type.Commit = false; 
billSchema2.DocumentSummary.Type.LinkedCommand = null; 

var command2 = new Command[] 
{ 
     new Value { Value = "Bill", LinkedCommand = billSchema2.DocumentSummary.Type}, 
     new Value { Value = "17000034", LinkedCommand = billSchema2.DocumentSummary.ReferenceNbr}, 
     billSchema2.Applications.DocTypeDisplayDocType, 
     billSchema2.Applications.ReferenceNbrDisplayRefNbr, 
     billSchema2.Applications.Balance, 
     billSchema2.Applications.AmountPaid 
}; 
try 
{ 
     var applications = context.AP301000Export(command2, null, 0, false, true); 
     .......................... 
    } 
    catch(Exception x){} finally{context.Logout()} 

回答

4

Here is the link to WebClientProtocol.Timeout property on MSDN - 这是更好的方式来检查MSDN因为超时属性是从一个基类派生在.NET Framework

做这将是改变屏幕的超时值的方法目的。 就你而言,我认为该对象是“上下文”。

默认值是100000,这是以毫秒为单位,所以1分40秒。如果您要将此值更改为大约11分钟半的700000,则应该没问题。

以下是如何操作:

context.Timeout = 700000;

+0

谢谢,它工作:) – HariEko