How to open the details form while we create the new record from the listpage

In New form


Form Level Methods:

public class FormRun extends ObjectRun
{
    QueryBuildDataSource qbd;
    Query                q;
    SysTableLookup       systablelookup;
    FormRun                 callerform;
}


public void close()
{
    super();
    callerform.dataSource().research();
    callerform.dataSource().reread();
}

public void init()
{
    callerform = element.args().caller();
    super();
}

public void closeOk()
{
 
    Args args = new Args();
 
    ;
    super();
}




In OK button Clicked Method :


void clicked()
{
 
    MenuFunction                            mf;
    args                                    args = new Args();
    ;
 
    args.record(UnitReservation);
    mf = new menufunction(menuitemDisplayStr(UnitReservationDetails), MenuItemType::Display);
    mf.run(args);
    super();

}

In Details Form :

Form Level Method

public class FormRun extends ObjectRun
{
    UnitReservation            _unitReservation;    //Parent Table //
}

public void init()
{
    _unitReservation = element.args().record();
    super();
}

Parent Datasource Methods :

public void executeQuery()
{
    this.query().dataSourceTable(tableNum(UnitReservation)).addRange(fieldNum(UnitReservation,RecId)).value(int642str(_unitReservation.RecId));
    super();
}




Comments

Popular posts from this blog

Create RFQ through X++

Base enum values in Dynamics 365

Project Id through X++ code