Friday, October 17, 2014

CREATAING OF DIALOG AND IT HOLD ONE RECORD

CREATAING OF DIALOG  AND IT HOLD ONE RECORD

STEP-1 CREATE A NEW CLASS (CustCreate)  AND CREATE CLASS DECLARATION

class CustCreate extends RunBase
{
    DialogField fieldAccount,fieldName,fieldGroup,
                fieldCurrency,fieldPaymMode,
                fieldPaymTermId;
    CustAccount custAccount;
    CustName    custName;
    CustGroupId custGroupId;
    CurrencyCode currencyCode;
    CustPaymTermId paymTermId;
    CustPaymMode paymMode;


}


STEP 2:- Create pack method  in class
public container pack()
{
    return conNull();
}

STEP 3-  Create Unpack method
public boolean unpack(container _packedClass)
{
    return true;
}

STEP 4 :-  Create a Dialog method for dialog
protected Object dialog()
{
    Dialog dialog;
    DialogGroup groupCustomer;
    DialogGroup groupPayment;

    dialog = super();

    dialog.caption("Customer information");
    fieldAccount = dialog.addField(extendedTypeStr(CustVendAC),"Customer Account");
    fieldName = dialog.addField(extendedTypeStr(CustName));
    dialog.addTabPage("Details");
    groupCustomer = dialog.addGroup("Setup");
    fieldGroup     = dialog.addField(extendedTypeStr(custGroupId));
    fieldCurrency = dialog.addField(extendedTypeStr(currencyCode));
    groupPayment = dialog.addGroup("Payment");
    fieldPaymTermId = dialog.addField(extendedTypeStr(CustPaymTermId));
    fieldPaymMode = dialog.addField(extendedTypeStr(CustPaymMode));
    return dialog;


}

STEP 5 :-  Create GetFromDialog  Method

Public boolean getFromDialog()
{
    custAccount = fieldAccount.value();
    custName   = fieldName.value();
    custGroupId = fieldGroup.value();
    currencyCode = fieldCurrency.value();
    paymTermId = fieldPaymTermId.value();
    paymMode  = fieldPaymMode.value();
    return super();
}

STEP6:- Create Run method for dialog
public void run()
{
    info("you have entered customer information :");
    info(strFmt("Account : %1",custAccount));
    info(strFmt("Name : %1", custName));
    info(strFmt("Group: %1", custGroupId));
    info(strFmt("Currency: %1", currencyCode));
    info(strFmt("Terms of Payment: %1 ", paymTermId));
    info(strFmt("Method of Payment : %1", paymMode));
}


STEP7:- Create Main Method

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







No comments:

Post a Comment