Thursday, April 22, 2010

Creating a Dialog in X++

Creating a Dialog in X++ or AX 2009

static void CreateDialog(Args _args)
{
  Dialog dailog= new Dialog("Nikhil");//(Created a object of Dialog class)
  Dialogfield field1,field2,field4,field3;//(objects of Dialog field Returns Dialogfield)
  DialogTabpage tab;//(object of DialogTabpage)
  ;
  field1=dailog.addField(typeid(Transdate));//(Parameter should be EDT or Enum)
  field2=dailog.addField(typeid(AccountName));
  field4=dailog.addField(typeid(CustName));

  tab   =dailog.addTabPage("Overview");//(Creates a new Tab Page )
  field3=dailog.addField(typeid(ABC)); //(Once you create Tab page All the fields after that will in     that )
  dailog.addGroup('Help');//(Creates a  Group)
  dailog.addField(typeid(ItemId));//(Now all the fields will be in Group Help)
  dailog.addText("I am Called"); //(adds text)

  if(dailog.run())//(Checks whether Dialog is running or not)
     {
    info(strfmt("%1,%2",field1.value(),field2.value()));//(Gives Value of field1 and field 2)
     }
}

The Output  will be as follows

No comments:

Post a Comment