How to set timeout when exporting data using webservices api in acumatica

This is the first scenario: - I create a new document "bill" in the acumatica system using the webservices api for the Bill and Adjustments screen (AP301000). - after that I need to load all document records in the Applications tab menu of the current screen (AP301000) using webservices also to start the process the problem is that there are many documents to be uploaded. This is about 9500 documents and, of course, it takes more time to continue (this is about 10 minutes).

I always get an error when exporting all entries in this menu of the Application tab. and the error message is "Job Timeout".

Is there a link to setting a timeout in the process of exporting huge documents via 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()}

      

+3


source to share


1 answer


Here is a link to the WebClientProtocol.Timeout property on MSDN - better check MSDN as the Timeout property comes from one of the base classes in the .Net framework

The way to do this is to change the Timeout value of the Screen object. In your case, I think the object is the "context".

The default is 100000, which is milliseconds, so 1 minute 40 seconds. If you have to change this value to 700000, which is about 11 minutes and a half, you should be fine.



Here's how to do it:

context.Timeout = 700000;

+4


source







All Articles