Item = Record datatype, filtered to your record
TemplateMgt = Codeunit Template Management
RecRef = RecordRef datatype
Be sure you retrieve your record again after this so your ITEM record has the changes. Otherwise, any other mods that follow could wipe out what you did with your template update as your version of the ITEM record will overwrite the one modified through the codeunit.
Template to modify may not available as it need to perform several validations.
I believe, it is not really a good to have a template for modification.
Creation happens once for a record - modification can happen number of times - when to trigger the template and every time checking the validations may not appropriate...
Comments
// APPLY TEMPLATE
RecRef.GETTABLE(Item);
TemplateMgt.UpdateRecord(DataTemplateHdr,RecRef);
Item = Record datatype, filtered to your record
TemplateMgt = Codeunit Template Management
RecRef = RecordRef datatype
Be sure you retrieve your record again after this so your ITEM record has the changes. Otherwise, any other mods that follow could wipe out what you did with your template update as your version of the ITEM record will overwrite the one modified through the codeunit.
http://www.archerpoint.com/blog/faithie-robertson
A blog by Faithie Robertson
Your solution is for AX 2009 ?
Regards,
/Ashlesh
I believe, it is not really a good to have a template for modification.
Creation happens once for a record - modification can happen number of times - when to trigger the template and every time checking the validations may not appropriate...