May be I have discovered this late but thought of sharing this. Better late than never. Recently I got a requirement where in I had to say start with 4 items in a radio button and display and in the run-time depending on some conditions I had to change/add/remove elements from the Radio button. Now how do we handle this situation. I knew that we can show items in radio buttons using Base Enums. But then I thought why to create so many different Enums for one radio button. I was looking at something which could give me a clue on this. I just chanced upon two properties of Radio Button Item and Items I read more about this and bingo I got the solution. Basically Item and Items is similar to what we have in a .Net language where-in you can define a collection of items for a control. But unlike .Net in AX to define such a collection, there is a slightly different way. Here is what you need to do.
With this option availabe, I was easily able to play around with radio button items. You can try out this one as well
|
|||||||
| Comments | 7 | Hits: 1322 |
In this article, I am going to explain about different ways through which one can connect to different databases for data manipulation operations. In AX, the methods that I know are following. Please feel free to add more methods that you feel are also available.
Let us go through each of these options one by one. ODBC Connection: ODBC stands for Open Data Base Connectivity. It is a connection that is created to define a connection between a computer and a database stored on another system. The ODBC connection contains information needed to allow a computer user to access the information stored in a database that is not local to that computer. In Dynamics AX, we have ODBCConnection class to carry out this type of database connection need. This class uses LoginProperty class for login information and uses Statement and ResultSet classes for carrying out DML operations. Below is an example of how to use this class.
The above sample code is a job. Note that you may have to use respective permission classes like SQLStatementExecutePermission etc. while using in classes and any other place. Note that if you need to invoke a stored procedure then just type exec in the executeQuery instead of the select statement. ADO Connection: ADO is an abbreviation for ActiveX Data Objects. ADO is a set of COM objects for accessing databases or data stores. In AX we have following objects making a collection for implementing ADO concept.
The example below demonstrates the working of some of these classes:
The above sample code is a job. Note that you may have to use respective permission classes like SQLStatementExecutePermission etc. while using in classes and any other place. OLEDB Connection: OLEDB stands for Object Linking and Embedding, DataBase. It is a set of APIs designed by Microsoft and used for accessing different types of data stored in a uniform manner. Dynamics AX as such doesn't have any specific classes built for this purpose. But one can make use of .Net Framework's System.Data.OleDb namespace through AX's COM Interoperability feature and use it in AX. Below is an example code that depicts this scenario:
Connection Class: Connection class is mainly used for accessing the database in which a user has logged into AX i.e. Current Database and carry out the operations. This class is exetensively used in ReleaseUpdateDB classes, the classes used in data upgrades. This class cannot be run on client and should always be run on server. One more unique thing that I noticed is that the statements that you want to execute should be asserted first for permissions and then passed on to other method where they are executed. Create a class with following methods and set its RunOn property to Server.
Now you can call the method in a job as shown below:
These examples shown here are pretty simple and easy to understand and start with. Hope it helps you in building 'connections'
|
|||||||
| Comments | 2 | Hits: 2989 |

Blogs




