In NAV 2017, there is a Template feature, for example in Item card.
We can setup the Template, with the default value we want to fill the master card with. For example: for Retail items, the Gen. Prod. Posting Group is RETAIL, while for Manufactured items, must be MANUFACT.
Then, each time we create a new item card, we can fill those fields with the default values, based on the template card. Saves time, and reduce human error as well.
But, the fields are limited. Luckily, we can extend the functionality by adding the new fields we need.
This is how:
PS. This walkthrough is only applied to Item Template, but should be work in the other templates in the same logic.
- On Item Template table (301), design, and add new fields you want, e.g. Item Tracking Code and Lot Nos. Add too on Item Template Card page (1342). Notice that the fields ID must be the same as the master table’s ID, i.e. 6500 for Item Tracking Code, and 6501 for Lot Nos. Tip: you can look Item table (27) for the fields ID.
- On CreateFieldRefArray function, add a new line of code for each a new field added. So, in my example, I must add 2 lines of code, mentioning the new field name: AddToArray(FieldRefArray,I,RecRef.FIELD(FIELDNO(“Item Tracking Code”)));
- Since FieldRefArray variable is using array, so we must enlarge the array dimensions on some of these functions (both parameters or local variables). Since I add 2 new fields, then I must change the array dimension from 17 to 19.
This way, you can setup the default values for Item Tracking Code and Lot Nos. on your template card, then will be populated automatically when you apply the template.