Master Template - data from more tables

bstoyanobstoyano Member Posts: 134
hi guys,

I am creating master templates for Items. I would like to set default values for fields in another table as well, not only in Item table. E.g. I want to set posting groups for the Item, but also an Item unit of measure. Is it possible to do it with one template?
I see that in the lines of the template there is a field Type, which can be either Field or Template. When I choose Type = Field everything works fine - I can select a field name. But if I choose Type = Template, then I cannot select anything in field Field Name. How do I use the Type = Template feature?
Boris
*
Please, do not frighten the ostrich,
the floor is concrete.

Comments

  • SavatageSavatage Member Posts: 7,142
    For us we can set the default for ItemUOM field but it doesn't create it in the ItemUOMtable.
    For that I added some code to the item table Oninsert trigger.
    I created a function called AutoFillUnitOfMeasure where I call it from the onInsert trigger.
    Hardcoding is not the way to go but in this case the BaseUOM will ALWAYS be 1 for us.
    OnInsert()
    //Autofill unit of measure to default
    AutoFillUnitOfMeasure;
    
    Function:AutoFillUnitOfMeasure()
      IF ItemUnitOfMeasure.GET("No.","Base Unit of Measure")
       THEN BEGIN
        VALIDATE("Base Unit of Measure");
      END
       ELSE BEGIN
        ItemUnitOfMeasure.Code := "Base Unit of Measure";
        ItemUnitOfMeasure."Item No." := "No.";
        ItemUnitOfMeasure."Qty. per Unit of Measure" := 1;
        ItemUnitOfMeasure.INSERT(TRUE);
        VALIDATE("Base Unit of Measure");
      END;
    
  • bstoyanobstoyano Member Posts: 134
    Thanks Savatage. But is it possible somehow to do it without adding code?
    What I am doing now is migrating a client from Nav 4 to Nav 5 and I try to avoid customisations if possible. In NAV 4 we have done a customisation for this too, but in NAV 5 we have this function Apply Template for Items and I wanted to make use of it.
    Boris
    *
    Please, do not frighten the ostrich,
    the floor is concrete.
Sign In or Register to comment.