Make SELECT direct in AX DB


Sorry for this -might be- stupid question but… I’m developing some bridges between AX2009 and PHP applications and I would like to be sure there is no problem to connect directly to the database with an user (which has only read access) to make only SQL SELECT commands.

Thank you,

One problem is security - users may have restricted access not only to tables and fields, but also to individual records (through record-level security).

You also won’t be able to use any business logic defined in AX. It includes both system functionality (virtual company accounts, time-zone handling etc.) and custom code (e.g. display methods).

If you’re developing something for a single customer, you might be able to review what functionality they use, reimplement what’s needed, let them to configure security setup for the user on DB-level etc. If you’re trying to build a more general solution, you’ll have to take into account all functionality that anybody may want to use.

In short, it’s possible, but not recommended. What’s recommended are web services going through AOS, which deals with all AX specifics.

Thank you for your reply.

As I’m just reading some basic informations (like prices or customers informations) in order to work with the frontend of an e-commerce website, there is no security issues. I mean no security issue like viewing confidential informations about transactions for example.

BTW, I’m developing for my own company, we have to launch this website asap, so for now I’ll keep the code connecting directly to SQL via PDO, but I’m highly interested in learning how to connect to business logic with the business connector.

Unfortunately I don’t speak .NET yet, so I will take a look to php’s DOTNET Classes.

Thank you again.

Just to make it absolutely clear, I don’t recommend you using Business Connector. On the contrary, I think you shouldn’t. It’s not clear whether Business Connector will be supported in future and service-oriented architecture offers many benefits. Among other things, it will be much easier for you in PHP consuming web services than calling Business Connector.

It’s especially true in AX 2012, where many things related to web services were greatly simplified and there are new features as well (such as general-purpose Query service). And you should think about AX 2012, because mainstream support of AX 2009 ends already next year.

Ok, I didn’t know about -probably- end of Business Connector support.

The only benefit for me and for now of using Business Logic would be to get special prices or discount per customer more easily, because now I’ve to rewrite a lot of code in php !

An automatic creation of sales orders from e-commerce to AX will be certainly needed in furture also. Impossible thru SQL directly.

If you’re choosing just between Business Connector and direct SQL, you’re still ignoring the best way.

For example, check out how simply you can create a sales order though an AIF document service: Creating sales orders via AIF in AX2012. (That’s supported by AX 2009 too.)

If you’re not familiar with web services, it’s time to change it. You can’t do much integration without them these days.

Thank you again, I will take the time to try this code and think about how to use it in my situation.