I used Fatih Demirci'nin this code:
public void jumpRef()
{
EmplTable emplTable;
Args args;
MenuFunction menuFunction;
;
emplTable = EmplTable::find(this.text());
if (!emplTable)
{
return;
}
args = new Args();
args.caller(element);
args.record(emplTable);
menuFunction = new MenuFunction( menuitemdisplaystr(EmplTable),
MenuItemType::Display);
menuFunction.run(args);
}
{
EmplTable emplTable;
Args args;
MenuFunction menuFunction;
;
emplTable = EmplTable::find(this.text());
if (!emplTable)
{
return;
}
args = new Args();
args.caller(element);
args.record(emplTable);
menuFunction = new MenuFunction( menuitemdisplaystr(EmplTable),
MenuItemType::Display);
menuFunction.run(args);
}
But actually this code behaves different from systems default "Go to main table" menu item. It just filter related record. Orijinal menu item just locate related record not filter. After a little search I wrote this code. It works just like original:
public void jumpRef()
{
CustTable custTable;
Args args;
MenuFunction menuFunction;
;
args = new Args();
args.caller(element);
args.lookupfield(FieldNum(CustTable,AccountNum));
args.lookupValue(this.text());
menuFunction = new MenuFunction(MenuItemDisplayStr(custTable),MenuItemType::Display);
menuFunction.run(args);
}
Hiç yorum yok:
Yorum Gönder