Nov 18, 2013

Confirmation message through BOX

Dialogbutton    dialogBtn;
;
dialogBtn  =   Box::yesNo("Are you sure to continue ", dialogButton::Yes, "Choose your option");
if (dialogBtn == dialogButton::Yes)
{
     info( "Process will be continued ");
}
else
if (dialogBtn == dialogButton::No)
{
      info( "Process stopped");
}

Nov 12, 2013

How to create a view in AX


AOT --> Data Dictionary --> View --> New View

New view --> RightClick --> Properties  ---> Provide Name , Label

2 . Select the Metadata node in the View --> Datasource --> Add Required Datasources

3 . Go to fields node of the view and create new fields .

4 . Select one of the field --> Right click --> Properties --> Provide the DataSource and field name

     Repeat same for all the fields in the View

Note  :- We can create FieldGroups and Methods if required

5 . Save the created view and Open . we can view the data in table style.

Note :- We can also add the query(AOT --> Query --> Our Own Query) to our view by draging and droping the query on to the metadata node.

Next is how can we add a View to the form ?

1 . Create a new form in the AOT --> Forms Node

2 .  Go to  Views node and select the view which we have to add to form

3 . Drag and drop the view on the Datasource node of the form and save

4 . Expand New form --> Datasource --> New View --> fields . Here you can see the list of fields which we created in view's fields node.

5 . Select the required fields , drag and drop on the design node of the form.

6. Save the form and open .. you can view the required data from different tables(Those added in View) on the same grid.









Nov 8, 2013

How to set a startup message for AX


1) Start  ==> ControlPanel ==>Adiministrative tools ==> Microsoft dynamics AX configuration
2) General tab , in start up message box , enter the message which we want to display ==> Ok

Infolog Msgs


SysInfologMessageStruct msgStrct;
;
msgStrct = SysInfologMessageStruct::construct("test");
info(msgStrct.message());

How to get query through code ?

static  void  TestQuery(Args _args)
{
       AifInboundPort                 aifInboundPort;
       Query                               query;
       QueryBuildDataSource     queryBDS;
       QueryRun                         qr;
        ;
       query =  new Query(queryStr("AifInboundPortQuery"));
    // queryBDS = query.dataSourceTable(tablenum(AifInboundPort)); // Optional
       qr = new QueryRun(query);

       while (qr.next())
       {
          // aifInboundPort = qr.get(tableNum(AifInboundPort));
             aifInboundPort = qr.getNo(1);
             info(aifInboundPort.AosChannelId);
       }

}