Tuesday 7 July 2015

Sys operation Framework

https://amazingax.wordpress.com/2012/12/28/simple-use-of-sysoperation-framerwork-in-ax-2012-part-1datacontract/
https://amazingax.wordpress.com/2012/12/29/microsoft-dynamics-ax-2012simple-use-of-sysoperation-frameworkpart-2attribute-based-customization-and-code-based-customization-using-uibuilder-class/
https://amazingax.wordpress.com/2013/01/05/microsoft-dynamics-ax-2012simple-use-of-sysoperation-frameworkpart-3sysoperationservicecontroller-class/

Delete Functions


Use of Cascade, Restricted and Cascade +Restricted (Delete action property for a table)
image018
Example of Cascade
Suppose we have two tables  (Customer & Order) and the relation is of One-To-Many i.e. Customer can have many orders
So on a parent table i.e.(Customer) if I set a delete action property to “CASCADE” for Order table. Then If I go and delete the record from a Customer table. It will also delete all the related records in Order table automatically
Example of Restricted
Suppose we have two tables  (Customer & Order) and the relation is of One-To-Many i.e Customer can have many orders
So on a parent table i.e.(Customer) if I set a delete action property to “RESTRICTED” for Order table. Then If I go and delete the record from a Customer table. It will first check the record in the child table and if exist that warning prompt saying that first we need to delete a record from child table.
Example of Cascade + Restricted
Suppose we have three tables  (Person ,Customer & Order) Now Person is a parent of Customer table, and Customer is a parent of Order table having (One-To-Many) relations
If I set a Delete action property on Person table to “CASCADE” for customer table  and If I set a  Delete Action property on a CUSTOMER table for Order table to “CASCADE +RESTRICTED”.
So if I delete a record from Customer table then It will first check the record in the child table(order table) and if exist that warning prompt saying that first we need to delete a record from child table.
But if I delete a record from Person table it will automatically delete a record in Customer table and all records related to customer table in Order table would also be deleted.

Monday 6 July 2015

Add a Button For Document Handling on a new AX form

I) To add this functionality you may need to perform following steps. 

Step 1. Open your form in AOT and Go to from Design node. 

Step 2. Add new button group under ActivePanTab. 

Step 3. Add new command button under this new button group. 

clip_image001 

Step 4. Set following properties of this button 

clip_image002 

Now you need to do one functional setup for this new customization 

Step 5: Open below from 
 Organization administration/SetUp-> Document Management -> Active Document Table 

Step 6: Add your table details here and click on Always enable. 

clip_image003

Step 7: So its done now. 
Open your form and click on Attachment button , below form must open. 

clip_image006



II)   Add Menu Item and Pass Datasource :

1.Add a menu item Button in Button Group
2. Set Button Group Property Datasource - with Form Datasource ( main )
3. Attachment - Image ( 2505)
4. MenuItemType- Display
5. Menu ItemName-DocuView
6. Check the DocuRef table and your table is related with Refrecid and RefTableid.