"No. Series" error in Navision 3.7

sizzlingUKsizzlingUK Member Posts: 4
Hi All,

I am facing problem with "No. Series". I have created one table whose primary key is "Change Request No.". I am trying to set no. series on it. I have set the series in the no. series table as CRN001 to CRN999 and set Default Nos. as True. I have also created setup table with Change request no. as a field.

I have written the following code:

OnValidate trigger:

IF "Change Req. No." <> xRec."Change Req. No." THEN BEGIN
GetChngMgtSetup;
NoSeriesManagementCU.TestManual(ChangeMgtSetup."Change Request Nos.");
"No. Series" := '';
END;

onInsert Trigger:

IF "Change Req. No." = '' THEN BEGIN
GetChngMgtSetup;
ChangeMgtSetup.TESTFIELD("Change Request Nos.");
NoSeriesManagementCU.InitSeries(ChangeMgtSetup."Change Request Nos.",xRec."No. Series",0D,"Change Req. No.","No. Series");
END;

I have created the following function and called it on the onAssistEdit() trigger of the field.

AssistEdit() : Boolean

GetChngMgtSetup;
ChangeMgtSetup.TESTFIELD("Change Request Nos.");
IF NoSeriesManagementCU.SelectSeries(ChangeMgtSetup."Change Request Nos.",xRec."No. Series","No. Series") THEN BEGIN
NoSeriesManagementCU.SetSeries("Change Req. No.");
EXIT(TRUE);
END;

Now, when I try to run the form, it gives me error saying "No. Series CRN001 does not exist". When I see the record in the table this no. is saved but does not allow me to open the form again.

Could anyone please help me on this?

Thanks
sizzlingUK

Comments

  • lakshmivallurulakshmivalluru Member Posts: 168
    Thsi may be because of code on onopenform() ? do u have any code on onopenform like filtergroup , setfilter, etc????
    LR
  • sizzlingUKsizzlingUK Member Posts: 4
    Hi Lakshmi,

    Thanks for reply but I have checked there is no code or filters on onopenform() trigger.

    Thanks
    sizzlinguk
  • ara3nara3n Member Posts: 9,257
    Turn on the debugger and run the form. Step through it and debug it.
    I'm sure it's a bug somewhere.
    Good luck
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,307
    Making numbering series work in new functionality is a little tricky. You should take a Cronus database and debug the process of creating a new Item. When you understand all the steps, you go back to your own code and you will find where this needs to be modified.
  • sizzlingUKsizzlingUK Member Posts: 4
    Thanks everybody. The error is solved now. what I did is, I deleted all tables and forms and created new from scratch. It worked. Don't know what was the error.

    Thanks
    sizzlingUk
Sign In or Register to comment.