Click the button to redirect to a form with X++
Regarding customer requests to create a new button to redirect to another related form once the user presses on the button with X++, we can use the code below:
[Control("Button")]
class RetailTransaction
{
/// <summary>
/// RetailTransaction clicked
/// </summary>
public void clicked()
{
RetailTransactionTable retailTransactionTable;
RetailTerminalId terminalId;
POSIntegrationTerminalMapping terminalMapping ;
Args args = new Args();
;
// get mapping terminal id
// TrackingRetailTransactionTable is DS
terminalMapping = POSIntegrationTerminalMapping ::find(TrackingRetailTransactionTable.Store, TrackingRetailTransactionTable.Terminal);
if(terminalMapping)
{
terminalId = terminalMapping.InternalTerminalId;
}
else
{
terminalId = TrackingRetailTransactionTable.Terminal;
}
select firstonly retailTransactionTable
where retailTransactionTable.store == TrackingRetailTransactionTable.Store &&
retailTransactionTable.transactionId == TrackingRetailTransactionTable.TransactionNumber &&
retailTransactionTable.terminal == terminalId;
args.record(retailTransactionTable);
args.parm(element.name());
new MenuFunction(menuItemDisplayStr(RetailTransactionTable),
MenuItemType::Display).run(args);
}
}
Comments
Post a Comment