Item template detail will be deleted if the item is deleted

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;

}