How to set No. Series?

sridhar
Member Posts: 171
Hi I want to create a No. field simillar to the No. field in the Customer Card form.
How to set a number series and assign it that particular No. Field?
Can any one please explain the steps..?
How to set a number series and assign it that particular No. Field?
Can any one please explain the steps..?
0
Comments
-
Number series are usually used for primary key fields. You need to be a little clear on what you are want to do. I'm going to assume you are going to create a new table let us call it WebUsers. The primary key of the field is No.
You need to create a field for the setup where you'll need to grab the right number series. I'm going to put a new field "WebUsers Nos." in Sales & Receivable Setup table. This field will link to number series table.
Then oninsert trigger of WebUsers I would put the following code.
NoSeriesMgt as CodeUnit NoSeriesManagement;
SalesSetup as Record Sales & Receivables Setup
IF "No." = '' THEN BEGIN
SalesSetup.GET;
SalesSetup.TESTFIELD("WebUsers Nos.");
NoSeriesMgt.InitSeries(SalesSetup."WebUsers Nos.",xRec."No. Series",0D,"No.","No. Series");
END;
and onvalidate of No. field
IF "No." <> xRec."No." THEN BEGIN
SalesSetup.GET;
NoSeriesMgt.TestManual(SalesSetup."WebUsers Nos.");
"No. Series" := '';
END;
That's it.0 -
Thanks ara3n,
Then how we are getting 3 dots at the end of the No. Field in the form..?0 -
HI Kowa
May be i m wrong but I think Sridhar is asking for AssistEdit Button on which u have three dots.
Sridhar, The three dots is visible if u write a Function on OnAssistEdit Trigger. Actually it is used to provide a option to the user to select the "No. Series" manually....i mean to say when user click on this Assist Button it will open the No. Series Form and user select the No. Series form it.0 -
Thanks Friends,
Then I m doing project related to the Financial Module. I want to know in which setup table I have to set the No. Series and how to set it..?0 -
ara3n wrote:Number series are usually used for primary key fields. You need to be a little clear on what you are want to do. I'm going to assume you are going to create a new table let us call it WebUsers. The primary key of the field is No.
You need to create a field for the setup where you'll need to grab the right number series. I'm going to put a new field "WebUsers Nos." in Sales & Receivable Setup table. This field will link to number series table.
Then oninsert trigger of WebUsers I would put the following code.
NoSeriesMgt as CodeUnit NoSeriesManagement;
SalesSetup as Record Sales & Receivables Setup
IF "No." = '' THEN BEGIN
SalesSetup.GET;
SalesSetup.TESTFIELD("WebUsers Nos.");
NoSeriesMgt.InitSeries(SalesSetup."WebUsers Nos.",xRec."No. Series",0D,"No.","No. Series");
END;
and onvalidate of No. field
IF "No." <> xRec."No." THEN BEGIN
SalesSetup.GET;
NoSeriesMgt.TestManual(SalesSetup."WebUsers Nos.");
"No. Series" := '';
END;
That's it.
May i know how about cases for those fields which are not primary key?
:roll: :roll: :roll:Nothing is impossible, Impossible is nothing.0 -
I tried code given by ara3n but giving error that
You have specified an unknown variable.
No. Series
Define the variable under Global C/AL Symbols?0 -
I think you should explain the business requirement as this thing looks a bit strange.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions