问题
This is the first scenario: - I create new "bill" document in acumatica system using webservices api to Bill and Adjustments screen (AP301000). - after that, I need to load all document records in Application tab menu of the current screen (AP301000) using webservices also for set off process. the problem is there are a lot of documents that will be loaded. It's about 9500 documents and of course need more times to proceed (it's about 10 minutes).
I always get an error in exporting process all records in this Aplication Tab menu. and the error message is "Operation Timeout".
Is there any reference to set the timeout in exporting process of a huge documents through the 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()}
回答1:
Here is the link to WebClientProtocol.Timeout property on MSDN - it's way better to check MSDN since the Timeout property is derived from one of base classes in the .Net framework
The way to do it would be to change the Timeout value of the Screen object. In your case, I think that object is "context".
The default value is 100000 and this is in milliseconds, so 1 minute 40 seconds. If you were to change this value to 700000 which is around 11 minutes and a half, you should be fine.
Here is how to do it :
context.Timeout = 700000;
来源:https://stackoverflow.com/questions/43273901/how-to-set-the-timeout-while-exporting-data-using-webservices-api-in-acumatica