Skip to main content
Answer

Add code to an existing button

  • March 17, 2023
  • 1 reply
  • 170 views

Michael Ndungi
Varsity I
Forum|alt.badge.img

Hello everyone,
How can I add a code(to print receipt) to this existing button called PROCESS without replacing the existing methods.
The PROCESS button  creates payment, invoices etc. on POS but it not printing the Receipt.
And I would like to add this functionality on it.

 

Kindly assist.
All responses will be highly appreciated.

Best answer by Naveen Boga

@development93  Below is an example of Overriding a button.

After invoking the base code, you can add your logic.

 

public delegate void TestActionDelegate();
[PXOverride]
public List<InventoryUpdate> TestAction(TestActionDelegate baseMethod) 
{
var baseResult = baseMethod(); // Invoke the Base Code

// WRITE YOUR LOGIC HERE
}

 

1 reply

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • March 17, 2023

@development93  Below is an example of Overriding a button.

After invoking the base code, you can add your logic.

 

public delegate void TestActionDelegate();
[PXOverride]
public List<InventoryUpdate> TestAction(TestActionDelegate baseMethod) 
{
var baseResult = baseMethod(); // Invoke the Base Code

// WRITE YOUR LOGIC HERE
}