Increment Code variable-Error

nazu
Member Posts: 70
Hi Experts,
Please help me with following situation
I have a code variable sat cd:='A001'.I want to increment it till 'A0015'.
How do increment?I used the strlen(cd)+1.but when the output reaches till A0010 it displayes some vague cahracters.Please help
Please help me with following situation
I have a code variable sat cd:='A001'.I want to increment it till 'A0015'.
How do increment?I used the strlen(cd)+1.but when the output reaches till A0010 it displayes some vague cahracters.Please help
0
Comments
-
If you think about it, this is how number series work. So look at codeunit NoSeriesManagement and you'll find an answer there.0
-
Thanks for the answer.I trued using that .I used the function getnextno.Bt it is not working0
-
this can't work...if you start with A001 the serie will go from A001 to A010 and then all the way through A999...you can't add one more character...
if you want A0015, you have to start your number serie from A0001, not from A001...0 -
How about A015?
Say example there is a field called ext.ref no
"Ext. Reference No."[STRLEN("Ext. Reference No.")]:=
"Ext. Reference No."[STRLEN("Ext. Reference No.")] + 1;
and based on certain parameter it ahs to be incremented.Say i give the ext as 'A001' and i give the other paramenter as 4.so it should generate from A001 to A016.The numbers are getting generated bt from A010 it is showing as A0&8(some symbol afte A).0 -
:shock:
this code comes directly from the hell...you have to learn the basic principles of NAV before writing code...i can't correct your code because it's completely wrong: square brackets...you have to study the manuals, ask a senior developer, see what standard code does, see online help...0 -
nazu wrote:"Ext. Reference No."[STRLEN("Ext. Reference No.")]:=
"Ext. Reference No."[STRLEN("Ext. Reference No.")] + 1;
This is translated (probably) to:
From "Ext. Reference No." take character at position x and turn it to the character represented by x + 1 in the current set.kapamarou wrote:look at codeunit NoSeriesManagement and you'll find an answer there.
Did you follow that advice? There is a call to INCSTR in that codeunit.0 -
[Topic moved from 'NAV Three Tier' forum to 'NAV/Navision Classic Client' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
I m nt getting it.i cant use directly incstr & getnextno throws an error0
-
-
cd:='A0001';
cduno.GetNextNo(cd,today,true);
It says A001 doesnt exist0 -
Yes, of course, the parameter is Number Series code, not number to increment... ;-) if you want to increment the string, use INCSTR function.0
-
I am not able to increment the code value.The code value is given manually say A0001.How do i increment.
Any more reply0 -
Have you read any of the documentation? Is there anyone experienced in your company to help you? :-k0
-
nazu wrote:I am not able to increment the code value.The code value is given manually say A0001.How do i increment.
Any more reply0 -
nazu wrote:I am not able to increment the code value.The code value is given manually say A0001.How do i increment.
Any more replykine wrote:If you want to increment the string, use INCSTR function.
A0002 := incstr(a00001);
A0010 := incstr(a00009);
and so on and so forth.
The answer has been given, but please tell me you are working on this for training and not for a customer.
(how to find incstr, in the code page, press F5, you can see 3 columns, in the first, search for SYSTEM, in the second, search for String, and you'll find all your (handy) string functions in the 3th column, a question about any variable in these columns, stand on it and press F1!)
0 -
Sog wrote:........(how to find incstr, in the code page, press F5, you can see 3 columns, in the first, search for SYSTEM, in the second, search for String, and you'll find all your (handy) string functions in the 3th column, a question about any variable in these columns, stand on it and press F1!
)
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