Contents tagged with PXDatabase

  • How to modify Query timeout in Acumatica

    Hello everybody,

    today I want to share with you some trick which I used for cases if I get error message that some select from Acumatica timed out. Sometime if you work with big tables ( ~2 millions of records ) you may face timeout errors. Especially it is troublesome for processing screens when you are ready to wait for some kind of functionality just in order to be complete. Let me introduce you to property DefaultQueryTimeout of PXDataBase.Provider static class. By default it's value is set to 90, which means that it will be executed by sql server for 90 seconds. I should admit that for majority of cases it is more then enough. Except for cases when you need to fix some bugs in code. … more

  • Execute stored procedure in Acumatica

    Hello everybody.

    I want to share if you need to execute stored procedure in Acumatica how to achieve it. 

    It's simple.

    1. Create Stored procedure in db.

    2. Use in your code PXDatabase.Execute.

    For example let's say you created stored procedure which has name DeletePrTranByPrPayrollAndPayrollDetailsId and takes as parameters @prPayrollRefNbr and @prPayrollDetailsID which are of type nvarchar.

    Then you can call stored procedure in the following way:

    var pars = new List<PXSPParameter>();

    PXSPParameter p1 = new PXSPInParameter("@prPayrollRefNbr", PXDbType.NChar, details.PayrollRefNbr);

    PXSPParameter p2 = new PXSPInParameter("@prPayrollDetailsID", PXDbType.NChar, details. … more