Tuesday, March 25, 2014

How to bring Lookup form in lookup in AX 2012

1.Create a Form like below based on the requirement.

       

2.Create a lookup method in Form design Field, paste the below code

    Args args;
    FormRun formRun;
    ;
    args = new args();
    args.parm( strFmt("%1",value)); // pass the argument if required to filter lookup Form
    args.name( formstr(InventSerialLookup) );     //Lookup Form name
    formRun = classFactory.formRunClass( Args );
    this.performFormLookup(formRun);

3. In Lookup Forms init method 

    public void init()
    {
          str            parms;    
          canSelect = false;
          super();
          if( element.args() )
          {
                parms = element.args().parm();
          }
         element.selectMode(sELECTEDFieldName);//to fetch the selected field value
    }

No comments:

Post a Comment