Posts

Showing posts with the label Ax Development

D365Ops Tip #1: Table browser

Image
It has been few months that the new AX, Dynamics 365 for Operations is released to market. And being a web client, the Business users and/or Application consultants working with AX, don't have the privilege of going into the AOT from the Client even with 'System Administrator' role in AX . And one of the most used tool used by any Developer and also sometimes by App. consultants is the Table browser accessing which is a bit different with the New AX - this post illustrates on how to achieve this with a Change in URL. We can start with an example, please observe the URL in the browser when you try to open the Users form (System Administration > Users > Users). https:// d365ops0516devaos.cloudax.dynamics.com / ?cmp=USRT&mi=SysUserInfoPage so now, from here if you want to open Table browser for "Users form", you can do so without using any tools by just changing the URL. https://d365ops0516devaos.cloudax.dynamics.com/?cmp=USRT& mi=SysTableBrow...

Code: X++ script to disable AX users

If you are looking for script to quickly disable AX users. This way you can keep people out of the AOS without actually needing to remove the user.    Three approaches for the code: 1. Simple Job to disable the specified user in UserInfo table. static void disableUsers(Args _args) {     UserInfo userInfo;     ;       //a00008 is the user id which we want to disable.     while select forUpdate userInfo where userInfo.id == 'a00008'     {         if(userInfo)         {             ttsBegin;                          userInfo.enable = 0;             userInfo.update();                          ttsCommit;       ...

AX Menu items and how to create menu item

Image
Menus Items You can use menu items to activate application objects from the user interface. Three types of menu items can be created: • Display - used for forms • Output - used for reports • Action - used for running processes Display Menu Items Are used to open objects that appear on the screen, typically forms. For example, clicking the Customers menu item in the Accounts Receivable module opens the CustTableListPage form. This Display Menu item points to the Form object CustTableListPage. There are two important Properties to notice. • Object type = Form • Object = CustTableListPage   How to: Create a Menu Item Task: To create a menu item to open the AJ_BookTypeForm To understand the example scenario - Go here 1. Open the AOT, expand the Menu Items node. 2. Open a second AOT and locate the AJ_BookTypeForm 3. Drag the AJ_BookTypeForm form to the Display node of the Menu Items node. A new display menu item is created. 4. In the properties shee...

How to: Create a Form

Image
To create a form that will be used to view, create and edit records in the AJ_BookTypeTable. 1. In the AOT, right-click the Forms node and select New Form. 2. Rename the form to AJ_BookTypeForm. 3. In a second AOT, locate the table AJ_BookTypeTable. 4. Drag the table AJ_BookTypeTable to the DataSources node on the AJ_BookTypeForm 5. Expand the Designs node on the AJ_BookTypeForm. 6. Right-click the Designs node and select New Control > Grid. A new Grid control is created. 7. Expand the DataSources > AJ_BookTypeForm > Fields node. 8. Drag the fields AJ_BookTypeID and Name to the grid control. 9. On the properties sheet for the Design node, in the Caption property, enter "Type of books". 10. Save your changes to the form. To understand the example scenario - Go here  

How to: Create a Relation

Image
Use this step procedure to create a relation between the AJ_SubGenreTable and the AJ_BookTypeTable. The Sub-genre is related to the BookType table. For example, the Sub-Genre 'Poems' can be only related to the record "Poetry" in the AJ_BookTypeTable table. You should not be able to have a "Novels" as Sub-genre for "Poetry". To understand the example scenario - Gohere To understand more details about types of relations: Gohere . 1. In the AOT, locate the AJ_EDTBookTypeID EDT. 2. Right-click the AJ_EDTBookTypeID EDT and select Properties. 3. In the ReferenceTable property enter AJ_BookTypeTable. 4. Close the properties sheet. 5. Expand the AJ_EDTBookTypeID node. 6. Right-click the Table References node and select New > Table Reference. A new table reference is created. 7. Right-click the AJ_BookTypeTable Table Reference and select properties. 8. In the related field property, enter AJ_BookTypeID 9. Close the property sheet...

How to: Create an Index and set it as primary

Image
How to: Create an Index Use the following procedure to create a new index on the AJ_BookTypeID field on the AJ_BookTypeTable NOTE: A field of data type memo or container cannot be used in an index. To understand the example scenario - Go here 1. Locate the AJ_BookTypeTable table in the AOT. 2. Right-click the Indexes node in the table and select New Index. A new index Index1 is created. 3. Rename the index to AJ_BookTypeIDIdx 4. Drag the field AJ_BookTypeID to the index AJ_BookTypeIDIdx node. 5. In the properties sheet for the AJ_BookTypeIDIdx node, set the property AllowDuplicates to No. How to: Set a Primary Index Use the following procedure to set the index created in the previous procedure to be a primary index. 1. In the AOT, locate the AJ_BookTypeTable table. 2. In the property sheet for the table, set the PrimaryIndex property on the table to AJ_BookTypeIDIdx 3. Close the property sheet for the table.  

How to: Create a New Table

Image
Use the following step procedure to create a new table that will store the records for the BookType. There are two fields on the table called BookTypeID (type AJ_EDTBookTypeID), and Name (type Name). To understand the example scenario - Go here 1. Open a new development workspace. 2. In the AOT, expand the Data Dictionary node. 3. Right-click the Tables node and select New Table. A new Table called Table1 is created. 4. Right-click Table1 and select Properties. 5. Modify the property Name to AJ_BookTypeTable 6. Modify the property Label to "Types of Books" 7. Close the property sheet. 8. Press Ctrl-D to open another AOT. Ensure window is not maximized by clicking the restore down button to enable you to view both AOT windows. 9. Expand the Data Dictionary node. 10. Expand the Extended Data Types node. 11. Locate the AJ_EDTBookTypeID EDT. 12. Drag the AJ_EDTBookTypeID EDT to the Fields node of the AJ_BookTypeTable table. A new field called AJ_E...

How to: Create a New Extended Data Type

Image
Use the following procedure to create a new EDT that will define how the Id of the BookType is stored. To understand the example scenario - Go here 1. Open a new development workspace. 2. In the AOT, expand the Data Dictionary node. 3. Right-click the Extended Data Types node. 4. Select New > String. A new EDT called Type1 is created. 5. Right-click Type1 and select Properties. 6. Modify the property Name to AJ_EDTBookTypeID. 7. Modify the property Extends to SysGroup. 8. Modify the property Label to “Type of Book”. 9. Close the property sheet and click Save in the AOT to save your changes. 10. On the Database Synchronization dialog, click Yes. This will take a few minutes to complete.

How to: Create a New Model and Development Project

Image
Example Scenario: Let’s try out to learn more by building up an example scenario from scratch. We shall have step-by-step procedures to demonstrate how to create a various levels of modification that can be used in Maintenance of Library. The procedure will need to keep track of each book that is borrowed, the readers who borrow, the Book type, the SubGenre of the book and details of each visit to library including the date, reason and the cost. To do this you will need to create the following new tables. • BookType table: This will contain entries such as Fact information, Current affairs, Non-fiction, Fiction, and so on. • SubGenre table: This will contain the info about various sub-genres a book can have based on the book type. Would have entries like Novels, Biographies, Poems and so on. This should be related to the BookType Table. • BookLendtable: This information is related to the customer table and BookType table. • Visit transactions: This will contain the details ...