SBX - Search With Button

SBX - Forum Post Title

No. series is not working

Microsoft Dynamics NAV Forum

NAV Beginners asked a question on 12 Jan 2019 4:40 AM
My Badges

Question Status

Suggested Answer

Dear Experts,

In my dimension master there have a dimension the name is "RND". Against RND dimension I want to run the no. series to generate the dimensions value.

Code, I have added it but it is not working. no. series is not generating automatically. In my table 349 I have added the below code:

OnInsert()

//Generate No. series BEGIN
SalesSetup.GET;
NoSeriesCode := '';
IF Code = '' THEN BEGIN
NoSeriesMgt.InitSeries(SalesSetup."R&D Dimension No. Series",'',WORKDATE,Code,NoSeriesCode);
END;
//Generate No. series END

Here all variables are below:

Name                  DataType         Subtype Length
SalesSetup           Record            Sales & Receivables Setup
NoSeriesMgt       Codeunit         NoSeriesManagement
NoSeriesCode     Code              10

Reply
Jesús Almaraz Martín responded on 14 Jan 2019 12:52 AM
My Badges
Suggested Answer

Try this function instead InitSeries:

Code := NoSeriesMgt.GetNextNo(NoSeriesCode,WORKDATE,TRUE);

Reply
NAV Beginners responded on 17 Jan 2019 5:13 AM
My Badges

I have tried with but there is no effect.

Reply
Jesús Almaraz Martín responded on 18 Jan 2019 12:22 AM
My Badges

I noticed that "NoSeriesCode := '';" leaves teh series code to blank. So there you can´t retrieve any new number this. You can show me all the function code?

Best regards.

Reply
NAV Beginners responded on 18 Jan 2019 1:01 AM
My Badges

Thank you very much for your proper support. Actually solution is not working. My code is below.

I would request you, please review my screenshot and suggest me where I am doing wrong. Waiting for reply.

//Generate No. series BEGIN
SalesSetup.GET;
NoSeriesCode := SalesSetup."R&D Dimension No. Series";
IF Code = '' THEN BEGIN
Code := NoSeriesMgt.GetNextNo(NoSeriesCode,WORKDATE,TRUE);
END;

//Generate No. series END

Here NoSeriesCode is a code type variable length is 10.

Reply
Jesús Almaraz Martín responded on 14 Jan 2019 12:52 AM
My Badges
Suggested Answer

Try this function instead InitSeries:

Code := NoSeriesMgt.GetNextNo(NoSeriesCode,WORKDATE,TRUE);

Reply

SBX - Two Col Forum

SBX - Migrated JS