New line in-between the lines
sneha
Member Posts: 191
Hi Experts,
Can we restrict users from entering a new line in-between the lines?
Usually System automatically generates a line number as 10000,20000,……..
Client considering a line number as 1,2…. And always want that line number must be in sequence.
But somehow users entering a new line in-between the lines, when user enters a new line in-between 10000 and 20000, system automatically generating a line number as 15000. How can we restrict the users from entering a new line in-between the lines?
Can we restrict users from entering a new line in-between the lines?
Usually System automatically generates a line number as 10000,20000,……..
Client considering a line number as 1,2…. And always want that line number must be in sequence.
But somehow users entering a new line in-between the lines, when user enters a new line in-between 10000 and 20000, system automatically generating a line number as 15000. How can we restrict the users from entering a new line in-between the lines?
0
Answers
-
In the OnInsert trigger of the line table you could add code like below:
Line2.SETRANGE("Document Type","Document Type");
Line2.SETRANGE("Document No.","Document No.");
Line2.SETFILTER("Line No.",'>%1',"Line No.");
IF NOT Line2.ISEMPTY THEN
ERROR('You cannot add an in-between line');
Line2 is a variable type Record for the Line table. You need to add it as a local variable, to the OnInsert trigger.0 -
or, if you need it ever at the end, try this:
OnInsert() //OnInsert in MyTable MyTableAsVariable.RESET; MyTableAsVariable.SETFILTER(Primarykeyfields,Values); IF MyTableAsVariable.FINDlast THEN "Line No." := MyTableAsVariable."Line No." + 10000;
regardsDo you make it right, it works too!0 -
can't we set AutoSplitKey to False :-k0
-
mohana_cse06 wrote:can't we set AutoSplitKey to False :-k
Then the "line No." is 0Do you make it right, it works too!0 -
garak wrote:mohana_cse06 wrote:can't we set AutoSplitKey to False :-k
Then the "line No." is 0
Yes garak,you are right #-o
Thanks0 -
so, if he really want it, that no line should be inserted (per hand) between line 10000 and line 20000 u must use the OnInsert solution (the standard does this also do, for example in table 5741).
But explain the customer, what for an comfort then he lost.Do you make it right, it works too!0 -
Thank you Karenh and garak0
-
Please and welcomeDo you make it right, it works too!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
