Dialog Override Modified mehtod in Ax 2012

class Test_DialogField extends RunBasebatch
{
CustAccount CustId;
DialogField dialogCustId;
DialogField dialoglName;
Dialog dialog;

#define.CurrentVersion(1)

#localmacro.CurrentList
CustId
#endmacro
}

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

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

static void main(Args args)
{
Test_DialogField tmpDialogField = new Test_DialogField();
;

if (tmpDialogField.prompt())
tmpDialogField.run();
}

public void dialogPostRun(DialogRunbase tmpdialog)
{
super(tmpdialog);
tmpdialog.dialogForm().formRun().controlMethodOverload(true);
tmpdialog.dialogForm().formRun().controlMethodOverloadObject(this);
}

protected Object dialog()//DialogRunbase tmpdialog, boolean forceOnClient)
{
;
dialog = super();//tmpdialog,forceOnClient);
dialogCustId = dialog.addFieldValue(typeid(CustAccount),”Customer”, “Customer”);
dialoglName = dialog.addFieldValue(typeid(Name),”Name”, “Name”);

return dialog;
}

public boolean fld1_1_modified()
{
FormStringControl control = dialog.formRun().controlCallingMethod();
boolean isFieldModified;
;
isFieldModified = control.modified();

if(isFieldModified)
{
dialoglName.value(custTable::find(control.text()).Name);
}
return isFieldModified;
}

Advertisements

How to get input from user using Dialog

This is my Table

 Bill_TableData

Step 1.First we have to create Dialog object for the Dialog Class.

Step 2.Then create object for Dialog group and Dialog field.

Step 3.Use extendedTypeStr for every dialog field

CODE:

static void SQLNameByID(Args _args)

{

Bill_TabMethod btm;

Dialog dialog;

dialogGroup dialogGroup;

dialogField dialogField;

dialog = new Dialog(“Johnkrish Dialog”);

dialogGroup = dialog.addGroup(“Customer Name”);

// while select * from btm

dialogField = dialog.addField(extendedTypeStr(CustName));

if (dialog.run())

{

while select * from btm

where btm.CustName==dialogField.value()

Box::info(btm.ItemName);

}

}

Step 4. Now run the code the Dialog will appear

DialogInputDialogOutput

Step 5. Input the Customer name then click OK. It will give the output of Item name as Keyboard

for the given Customer name Gopal

Yes you have done…