Dynamics AX In-Market Engineering

Dynamics AX In-Market Engineering (Sustained Engineering)

Item template detail will be deleted if the item is deleted

Item template detail will be deleted if the item is deleted

  • Comments 1
  • Likes

If the original item in the Inventory Table is deleted,  then the records in the tables, with itemID field, will also be deleted. Since this is a general issue for the record templates feature in Ax, and is caused by the fact that deleting templates is not supported, SE’s recommendation for solving this issue is as below.

 

This fix is applied in \Classes\SysRecordTemplate:initValue().

 

Change:

 

    if (common.TableId == tablenum(EventRuleData))

        excludeValidateField.add(fieldId2Ext(fieldnum(EventRuleData,RuleId),1));

 

To:

    switch(common.TableId)

    {

        case tablenum(EventRuleData):

            excludeValidateField.add(fieldId2Ext(fieldnum(EventRuleData,RuleId),1));

            break;

        case tablenum(InventTableModule):

            excludeValidateField.add(fieldId2Ext(fieldnum(InventTableModule,ItemID),1));

            break;

        case tablenum(InventItemLocation):

            excludeValidateField.add(fieldId2Ext(fieldnum(InventItemLocation,ItemID),1));

            break;

}

Comments
  • What does this "fix" do exactly? How does it "solve the issue"? Does it keep it from deleting the template detail? Or does it allow you to delete the template? Or does it keep you from deleting the item?

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment