Question

I have few questions regarding development in Visual Studio C# project for AX 2012.

There is a tool that provides Application Explorer from where you can drag any AOT item (Table, Class) in your project.

I dragged CustTable from the Application Explorer into my project and I can see the proxy class generated for it and all the methods that were in the Table are visible but I am interested to fetch all the records like below

select CustTable

So If I create object of the proxy class in Visual Studio how I will get all the records, there is one possibility to write a method in AX and call in the Visual Studio.

Second question is, I have created a class library and added in the C Sharp project of AOT, how I can use in the X++ classes? Is there anyway to call it. Please provide me some links related to it.

Was it helpful?

Solution

You can do one of the following : (assuming you have 2012 R2 by now)

  • You can use the new Linq provider: For sample code on how to do this, you can see here : http://msdn.microsoft.com/en-us/library/jj677293.aspx

  • You can use the table proxy as you mention above but this is done by using the find method on the Custtable.

    CustTable custtable = new CustTable(); custtable = CustTable.findByCompany(dataAreaId, accountNum);

  • You could also use the business connector which has been around for a while now. An example of this is found here : http://msdn.microsoft.com/en-us/library/cc197126.aspx (This lets you use things like : axRecord.ExecuteStmt("select * from %1"); )

OTHER TIPS

You can do something like this:

 CustTable c = new CustTable();
        c.ExecuteStmt("select * from %1");

        while (c.Found)
        {
            MessageBox.Show(c.Name);
            c.Next();
        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top