Loading ...

How To Read From Stored Procedure In Acumatica

Hello readers,

today I want to share hwo it is possible to read from stored procedure in Acumatica. Keep in mind, that reading from sp is against best practices of Acumatica, because if you read from sp, then you'll reading will not be cached and other side effects, but sometime you don't have a choice. So, for such cases you can try following approach:

create procedure uspWow

@invnbr nvarchar(6),

@money decimal(19,4) OUTPUT

AS

       SELECT @money = ARInvoice.CuryLineTotal

       FROM ARInvoice

       WHERE ARInvoice.RefNbr = @invnbr;

       RETURN

GO

 

 

var invNbr = new PXSPInParameter("invnbr""000595");

var money = new PXSPOutParameter("money"PXDbType.Decimal, 19, 4, null);

var results = PXDatabase.Execute("uspWow"new PXSPParameter[] { invNbr, money});

 

var sb = new System.Text.StringBuilder("PROC RESULT:\n");

foreach(var r in results)

{

    sb.AppendLine(r.ToString());

}

throw new PXException(sb.ToString());

 

If you found this guide on reading from stored procedures in Acumatica helpful, but you’re facing unique challenges or need custom solutions tailored to your business processes, we’re here to help! While stored procedures can be a workaround, Acumatica’s flexibility allows for powerful customizations that align with best practices.

Have a specific customization need? Let us know! Leave a customization request, and our team of Acumatica experts will work with you to design a solution that fits your requirements while optimizing performance and maintainability.

Your business deserves a system that works seamlessly for you—let’s build it together!

Be the first to rate this post

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5