Form 1 on Button Click :
[FormControlEventHandler(formControlStr(InventItemPrice, KMTItemPriceBreakdownForm), FormControlEventType::Clicked)]
public static void KMTItemPriceBreakdownForm_OnClicked(FormControl sender, FormControlEventArgs e)
{
Args args = new Args();
MenuFunction menuFunction;
public static void KMTItemPriceBreakdownForm_OnClicked(FormControl sender, FormControlEventArgs e)
{
Args args = new Args();
MenuFunction menuFunction;
InventItemPrice inventItemPrice = sender.formRun().dataSource("ItemPriceActivated").cursor();
args.record(inventItemPrice);
menuFunction = new MenuFunction(menuitemDisplayStr(KMTItemPriceBreakdownForm), MenuItemType::Display);
menuFunction.run(args);
args.record(inventItemPrice);
menuFunction = new MenuFunction(menuitemDisplayStr(KMTItemPriceBreakdownForm), MenuItemType::Display);
menuFunction.run(args);
}
Form 2 on Init:
[DataSource]
class KMTInventItemPriceBrkdwn
{
public void init()
{
super();
if(element.args().menuItemName() == menuItemDisplayStr(KMTItemPriceBreakdownForm))
{
InventItemPrice kmtinventItemPrice = element.args().record();
KMTInventItemPriceBrkdwn_ds.query().dataSourceTable(Tablenum(KMTInventItemPriceBrkdwn)).addRange(fieldNum(KMTInventItemPriceBrkdwn,ItemId)).
value(SysQuery::value(kmtinventItemPrice.ItemId));
}
}
[DataSource]
class KMTInventItemPriceBrkdwn
{
public void init()
{
super();
if(element.args().menuItemName() == menuItemDisplayStr(KMTItemPriceBreakdownForm))
{
InventItemPrice kmtinventItemPrice = element.args().record();
KMTInventItemPriceBrkdwn_ds.query().dataSourceTable(Tablenum(KMTInventItemPriceBrkdwn)).addRange(fieldNum(KMTInventItemPriceBrkdwn,ItemId)).
value(SysQuery::value(kmtinventItemPrice.ItemId));
}
}
}