[AX 2012] Integrate AOT Objects in Visual Studio

Hi All,

I’m using AOT Objects by Proxies in Visual Studio project, but I can’t retrive data from tables.

Who can help me?

Thank you!

And what’s the problem? If you don’t tell more, nobody can help you.

I made a class in the AOT for testing. It returns the first line of ProjJournalLine.

I have “linked” it in a Visual Studio C# Library Project and i have imported a link to ProjJournalLine too.

So when I call the method, the return is an ProjJournalLine object but all fields are null.

Could you show your code?

This is the method in the AOT Class

public ProjJournalTrans getLine( )


ProjJournalTrans jourTrans;

select firstonly jourTrans;

return jourTrans;


and this is the method in Visual Studio:

public string getProjJournalLine()


Axapta ax;



// Login to Microsoft Dynamics AX.

ax = new Axapta();

ax.Logon("", “”, aosConnString, “”);

tq_ProjJournalTransClass trans = new tq_ProjJournalTransClass();

ProjJournalTrans ret = trans.getLine();

return ret.JournalId;


catch (Exception e)


return e.Message;



I tested your code and it works for me, so I’m unable to reproduce the problem. But I see that you didn’t specify any data area - can’t the application read data from different company than you expect?

It is possible it doesn’t work because I’m writing an ASP application?

No, I don’t think so. You would get an error if the call didn’t work. Your connection to AX works, just the data set is empty.

By the way, debug problems in the simplest environment possible. For example, build a simple console application, debug your query and only then use it in something more complex. If you try to debug ten things in the same time, you will never know which one causes the problem.