Solved

How to retrieve values from Postman Request in C# code?

  • 19 January 2024
  • 1 reply
  • 47 views

 
I have created a custom button "Custom Create Payment". This custom button triggers another standard Acumatica button "Create Payment" which opens a popup window. I want to use Postman Request to change the data in the popup window. Here is the postman request 
 

Web service endpoints:

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
public static bool IsActive() => true;

public PXAction<SOOrder> customCreatePayment;

[PXButton]
[PXUIField(DisplayName = "Custom Create Payment", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
public virtual void CustomCreatePayment()
{
using (new PXTransactionScope())
{
var GraphExt = Base.GetExtension<CreatePaymentExt>();
try
{
GraphExt.createDocumentPayment.Press();
}
catch (PXException ex)
{

}

var values = GraphExt.QuickPayment.Current;

values.CuryOrigDocAmt = 500;
values.OrigDocAmt = 500;
var Paymentgraph = GraphExt.CreatePayment(values, Base.Document.Current, ARPaymentType.Payment);
Paymentgraph.SelectTimeStamp();
Paymentgraph.Save.Press();
}
}

}


Now everything works as it should, but the data is substituted from the code. In this case, 500. I want to substitute the value that I specify in the Postman Request. How to catch this data in the code?

icon

Best answer by Zoltan Febert 23 January 2024, 01:40

View original

1 reply

Userlevel 6
Badge +3

Hi @VladyslavPoberezhets,

I don’t think it is possible to use parameters here. When I had to solve a similar problem, I ended up with two API calls. The first call populated my custom field in the Sales Order records, while the second call triggered the action. In the action handler I had the previously populated value.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved