Options

Numbering series

shankshank Member Posts: 55
edited 2012-05-04 in NAV Three Tier
Is there a way to set the prefix (alpha) numbering series and then have users manually entry the number?

What I was hoping to do was have the user enter a part number but select the numbering prefix that was defined in numbering series, but be able to change the actual number portion.

We have 100 different items, and I didn't want people to enter different kind of items, typos etc, but be able to manually change the actual number.

Does that make sense? Is that doable?

Thanks

Comments

  • Options
    Faithie_RobertsonFaithie_Robertson Member Posts: 24
    Hmmm...now that's creative! :P If I understand you correctly, the alpha portion is always the same, right? You only want to let them enter the no. portion as anything they want.

    Let's see.... I suppose what you could do is set the existing no. series for the item to allow manual entry. Then in your "On Insert" trigger for the item - before it goes to the NoSeriesMgmt codeunit to find a number - purposefully call dialog for collecting the number from the user. Sort of like this:

    NoSeriesDialog.OPEN('Enter the part no.: #1#########',YourNo);
    NewControl := NoSeriesDialog.INPUT(1,YourNo);
    NoSeriesDialog.CLOSE;

    Once you have the number, you can concatenate your alpha prefix "CreatedNo := AlphaPrefix + format(YourNo)". I'd also recommend testing at that point to assure it has not already been used, and if so, return a nice soft error back to the user, and request "YourNo" again.

    In theory, 8) , it should work.
    So You Want to be NAV Developer?
    http://www.archerpoint.com/blog/faithie-robertson
    A blog by Faithie Robertson
  • Options
    thegunzothegunzo Member Posts: 274
    You can change the trigger for the field "No." in the Item table. Then standard code is
    IF "No." <> xRec."No." THEN BEGIN
      GetInvtSetup;
      NoSeriesMgt.TestManual(InvtSetup."Item Nos.");
      "No. Series" := '';
    END;
    

    Just change it to
    IF "No." <> xRec."No." THEN BEGIN
      Suffix := "No.";
      GetInvtSetup;
      InvtSetup.TESTFIELD("Item Nos.");
      NoSeriesMgt.InitSeries(InvtSetup."Item Nos.",xRec."No. Series",0D,"No.","No. Series");
      "No." := "No." + Suffix
    END;
    

    and create a local variable Suffix as Code 20.

    So when the user enters a new number it will always be prefixed by the number series.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
Sign In or Register to comment.