Tuesday, 4 September 2012

Lookup Filed On Dialog Box



public class CustAmountCalculation extends RunBase
{
    DialogField fieldAccount;
    CustAccount custAccount;

}


public Object dialog()
{

    Dialog dialog;
    DialogGroup groupCustomer;
    dialog = super();
    fieldAccount = dialog.addField(extendedTypeStr(custAccount), "CustomerAccount");
    return dialog;
}

public boolean getFromDialog()
{
    custAccount = fieldAccount.value();
    return super();
}

public container pack()
{
    return conNull();
}


public void run()
{
    CustTable custTable;
    CustTrans custTrans;
    ;

    select sum(AmountMST) from custTrans where custTrans.AccountNum == custAccount;
    info("You have enetered customer information");
    info(strfmt("Account: %1", custAccount));
    info(strFmt("Amount: %1", custTrans.AmountMST));
}

public boolean unpack(container _packedClass)
{
    return true;
}

public static void main(Args _args)
{
    CustAmountCalculation custAmountCalculation = new CustAmountCalculation();
    if (CustAmountCalculation.prompt())
    {
        CustAmountCalculation.run();
    }
}






No comments:

Post a Comment