Tags

, ,

class dialogTest extends RunBaseBatch
{

    DialogGroup dateGroup;
    DialogField fromDateDF;
    DialogField toDateDF;
    TransDate fromDate, toDate;

    #define.CurrentVersion(1)
    #LocalMacro.CurrentList
        fromDate,
        todate
    #EndMacro
}

now override dialog method of the class

protected Object dialog()
{
    DialogRunbase dialog = super();

    dateGroup = dialog.addGroup(“@SYS40”);
    dateGroup.frameType(1);
    dateGroup.columns(1);

    fromDateDF = dialog.addFieldValue(extendedTypeStr(TransDate), fromDate,”@SYS5209″);
    toDateDF = dialog.addFieldValue(extendedTypeStr(TransDate), toDate,”@SYS36680″);

    return dialog;
}

now override getFromDialog method of the class

public boolean getFromDialog()
{
    fromDate = fromDateDF.value();
    toDate = toDateDF.value();

    return true;
}

Override pack method

public container pack()
{
    return [#CurrentVersion, #CurrentList];
}

override unpack method

public boolean unpack(container packedClass)
{
    Integer version = RunBase::getVersion(packedClass);
    ;

    switch (version)
    {
        case #CurrentVersion:
        [version, #CurrentList] = packedClass;
        break;

        default:
        return false;
    }

    return true;
}

protected void new()
{
     super();
}

server static dialogTest construct()
{
    return new dialogTest ();
}

public void run()
{

    // your business logic
}

public static void main(Args _args)
{
    dialogTest testClass;
    ;
    testClass = dialogTest::construct();
    if(testClass.prompt())
    {
         testClass.run();
    }

}

Advertisements