Search This Blog

Friday 28 March 2014

Display filtered data in Reference groups.

Hi Dude,

Today Let us see how we will filter data in Reference group .

Most of the time there comes a situation, where one wants to display customized (filtered) data in reference groups.so here is a piece of code that satisfy your exact needs.You can filter the data according to your needs and displays it to the user.

In the example code below, i have used two tables, Student & Department.There is a foreign key relationship between Student and Department tables.Here a Department is associated to one or more Students. The Structure of the tables is shown in the figure below.





A ReferenceGroup control named "Department" is added on a form which contains all the values that are in Department table as shown in the figure below.



Now if we want to display(filter) only those Departments whose Dept(enum) value is Computer Science, in short we want to display only Computer Science departments like the one in the figure below.




For the above behavior of the ReferenceGroup, simply override the lookupReference() method of the Department field of the Student datasource and place the following code there.


Code Snippet.


    Common                                ret;
    SysReferenceTableLookup   sysReferenceTableLookup;
    QueryBuildDataSource         queryBuildDataSource;
    Query                                   query = new Query();
    sysReferenceTableLookup =
    SysReferenceTableLookup::newParameters(tableNum(Department),_formReferenceControl, true);
    queryBuildDataSource = query.addDataSource(tableNum(Department));
    queryBuildDataSource.addRange(fieldNum(Department,   Dept)).value(SysQuery::value(Dept::ComputerScience));

    sysReferenceTableLookup.addLookupfield(fieldNum(Department, Name));
    sysReferenceTableLookup.addLookupfield(fieldNum(Department, Dept));
    sysReferenceTableLookup.addLookupfield(fieldNum(Department, ID));
    sysReferenceTableLookup.parmQuery(query);

    ret = sysReferenceTableLookup.performFormLookup();
    return ret;


Happy Coding :)

Basic Setup For Creating a New Organization AX 2012



Hi Guys,

 Today i would like to share you what are the  Basic setup need to be done while creating a New Organization in AX  2012 . I will tell you step by step as below:


          1) Organization Administration -> common->organizations->Internal Organization


  

    2) General Ledger -> Setup-> Fiscal Calendar




3        3) General Ledger>Setup>Charts of Accounts>Charts of Accounts>New




  4)  General Ledger>Setup>Charts of account>Configure acct structure> New account structure




   5)  General Ledger>Setup>Ledger




                  6) General Ledger>Setup>Journals>Journal Names




That’s it……………….Done 

 Thanks , 
 Banu

How to Import and Export data using Office Add-In

Hi Guys,

Today i would like to share you about Office Add-In features and  how office Add-In helps us to import and export AX data.

click here to get a clear idea about Office Add-In features in AX.


Thanks , 
Banu 

Opening Outlook using AX Form

Hi Guys,

Today I will show you how to use ActiveX in Dynamics Ax

When creating an Axapta form, you can benefit from using ActiveX controls. An ActiveX control is a COM object that can be used as a graphical control inside an application.

The software available as ActiveX components spans from simple components such as check and combo boxes, to larger more complex components such as spreadsheets, calendars, Internet browsers, and communication programs.



I will tell you step by step as below:
You should have Microsoft Outlook installed on your system.

No warranties, use at your own risk.


1) Open your AOT and point to Forms.


2) Right click on Forms node and select New Form from the context menu as shown below

 
















3) Rename the form to OutlookAccess












4) Expand the Form nodes and to Designs>Design


5) Right click on Design>New Control>ActiveX as shown below

















ActiveX Browser will open. Select Microsoft Office Outlook View Control as shown below




















6) Create two Groups on form Design. Drag and drop the ActiveX control to the first group and in the second group add a ButtonGroup control as shown below.















7) Now add two buttons to the ButtonGroup. Add Override method "clicked" to each of the button.



8) In the first button's clicked method write "activex.Open();" before super(); as shown below;














9) Write "activex.AddressBook();" in the second button's clicked method before super();












Now your form design looks like this

























10) Save the form and run the form.

Hope it will help you a lot.

Thanks,
Banu


Exporting AX 2012 data with outbound Port

Hi Dude,

Outbound port is used to send ax 2012 data to external application .

click here to create a new outbound port and send ax 2012 data to external application

Thanks,
Banu


Creating a Custom Inbound AIF Service in Microsoft Dynamics AX 2012

Hi Dude,
       
Application Integration Framework (AIF) services are used to communicate with external systems or applications. Microsoft Dynamics AX 2012 has the following types of services:
  1. Document services
  2. Custom services
  3. System services
An AIF service can be Inbound or Outbound. An Inbound service is used when you want to send data to an external system and Outbound services are used when you want to retrieve data.

Click here to create a new  Custom Inbound AIF services in Microsoft Dynamics AX 2012.

Thanks,
Banu