To implement the table extension framework in Dynamics AX 2012 R3, following are the steps:
Assume that you have table SalesLine and you want to make extension table ISPLSalesLineExtension.
Step – 1: Add Relation
At SalesLineExtension table, add new relation named SalesLine, table SalesLine.
Add a new field ForeignKey -> PrimaryKey based at newly created ISPLSalesLineExtension table. Reference field to the primary table will be added automatically.
Note: if the parent table’s primary key is not RecId-based, but the table has CreateRecIdIndex property set to Yes, then the relation on step #1 should be created based on “Single field AlternateKey based”; otherwise the new field will potentially have wrong type, and it will not be possible to use it in the SysExtensionSerializerExtensionMap map.
Step – 2: Create a unique index for the reference field that points back to SalesLine .
Step – 3 Integrate with the table extensions framework
Add parent table (SalesLine – If it is standard table it might already be exist) to SysExtensionSerializerMap and child table (ISPLSalesLineExtension) to SysExtensionSerializerExtensionMap
Step – 4: Create methods at ISPLSalesLineExtension table
Step – 5: Create new field PackedExtensions in SalesLine.
This field is available in standard table (Check if already exists)
Step – 6: Add a delete action from the SalesLine to the ISPLSalesLineExtension table.
Step – 7: Create/Update methods at SalesLine table
Step – 8: Modify below methods on parent table. (SalesLine)
Check if code already exists if it is a standard table.
public void insert()
public void update()
Step – 9: Please be aware that write method of parent data source (SalesLine) should be modified:
public void write()
Write Method of child table triggers first and as a result child record will not be saved as it’s insert and update methods does not allow it without correct foreign key.
Step – 10: Modify Form Code as per below
Feel free to contact us in case of any query.
- Infographic: 7 trends why you need to move your accounting software to cloud - August 21, 2017
- Take supply chain management to the next level with Dynamics 365 - August 18, 2017
- How Field Service can boost your business revenue? - August 8, 2017
- Infographic: 10 reasons why companies use Microsoft Dynamics CRM - August 3, 2017
- 8 traits to look for in a Business Intelligence tool - July 31, 2017
- 6 Reasons your business needs a modern CRM system - July 24, 2017
- CRM: Why is it the most valuable asset for your business? - July 14, 2017
- Integration of Dynamics ERP and CRM for Retailers - July 11, 2017
- Consequences of Non-compliance under GST - July 4, 2017
- Impact of GST on Pharmaceutical Sector - June 21, 2017