Thursday, 6 October 2011

Display method "Go to main table"


Just a quick sample for those who need it.



Assuming you have a display method and you want to have "Go to the Main Table Form" for that field, all you need to do is overwrite the "jumpRef()" method.

Go to the form's control, expand it, right click on the "method" node, then "Override method" > "jumpRef".

Eg.
\Forms\WebOrder\Designs\Design\[Tab:TabOrder]\[TabPage:OrderOverview]\[Grid:Grid]\StringEdit:quotationId\Methods\jumpRef

public void jumpRef()

{
    SalesQuotationTable salesQuotationTable;
    Args                args;
    MenuFunction        menuFunction;
    ;

    salesQuotationTable = SalesQuotationTable::find(this.text());

    if(!salesQuotationTable)
        return;

    args = new Args();
    args.caller(element);
    args.record(salesQuotationTable);

    menuFunction = new MenuFunction(
                       MenuItemDisplayStr(SalesQuotationTable),
                       MenuItemType::Display);
    menuFunction.run(args);
}





No comments:

Post a Comment