Contents tagged with stored procedure

  • 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