Default the number series on the form

snehasneha Member Posts: 191
I have defined two separate number series codes for Sales Order Number generation, ISO and ESO (Internal and External Orders).
We have two separate sales orders forms (ISO form and ESO form), one for Internal Orders creation and other for External Order creation. But, list form is unique. That means, user can select the External Order through ISO form.
When user clicks F3 on ISO form, I always want to default the new number series to ISO series (irrespective of xRec.Sales Order Number Series) . Please suggest

Comments

  • DenSterDenSter Member Posts: 8,304
    Turn on the debugger, create a new sales order, trace the code and figure out how it decides which numbering series to use. Where it finds this in a certain setup, figure out a way to store a second (and perhaps even a third or more) numbering series, and program this process to include a condition under which it decides which numbering series to use.

    Hint: it has nothing to do with the form you are using.
  • snehasneha Member Posts: 191
    Thank you Denster! I have added below three lines of code to OnNewRecord trigger of the form and solves my current issue

    SalesSetup.get;
    "No. Series" := SalesSetup."Internal Order Nos."; // SalesSetup."External Order Nos." for External Orders
    xRec."No. Series" := SalesSetup."Internal Order Nos.";// SalesSetup."External Order Nos."; for External orders
  • DenSterDenSter Member Posts: 8,304
    That achieves your goal but it is not the right way. Code like that should never reside on the form.
Sign In or Register to comment.