Increment Entry No

Sugeevishere
Member Posts: 11
Hi Guys,
Im extremely new to NAV. I need a help from You all.
I have used the Entry No as the Primary Key in my Temporary Table. I want to increment it by one when i post a record. I have set Auto increment Property. But its not properly working.
Can some one write a coding to increment the Entry no by 1 when i post record every Time.
Any Help will be appriciated.
Thank You.
Im extremely new to NAV. I need a help from You all.
I have used the Entry No as the Primary Key in my Temporary Table. I want to increment it by one when i post a record. I have set Auto increment Property. But its not properly working.
Can some one write a coding to increment the Entry no by 1 when i post record every Time.
Any Help will be appriciated.
Thank You.
0
Answers
-
Autoincrement is not working on temporary tables... could you be more specific on how you are using the table?0
-
This code works without setting the AutoIncrement-property:
recYourTable.LOCKTABLE; IF recYourTable.FINDLAST THEN intNextEntryNo := intNextEntryNo + 1 ELSE intNextEntryNo := 1; recYourTable.INIT; recYourTable."Entry No." := intNextEntryNo; ...
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)1 -
Hi Guys,
Thanx for both's Reply.
@ Kine I meant by Temporary table is I didn't change the Table's Property as Temporary. This is a Temporary table. It means I do not store in my DB. I delete this table when i finish the job.
@ Luc van Dyck Its compiling perfectly. But The output is not corrrect. It Starts with Zero and It won't moves above that. Stays with Zero.
Can You Provide me a Solution on this?0 -
This is a Temporary table. It means I do not store in my DB. I delete this table when i finish the job.
Thus you used Temporary on the record variable to set it as temporary... ;-) if it is not stored in DB, it is temporary... and the autoincrement is not working, and the Luc's code too because it is on real table and it is empty...0 -
YA. U R CORRECT.
I JUST WANT TO IMPORT A TEXTFILE INTO A TABLE THROUGH DATAPORT. WHILE I IMPORT THIS ERROR OCCURS. THAT MEANS THE ENTRY DO NOT GOES ABOVE
ZERO AND ONLY ONE RECORD IS GETTING PRINTED. WAT KIND OF SOLUTION FOR THIS?0 -
1) Do not SHOUT...
2) I hope that you are not importing ledger entries through dataport... rather fill the journal and post the journal to create the entries.
3) You need to give us more details about how the dataport looks like, the data etc.0 -
If you start shouting, I'll just whisper your solution. Create a global variable of type intger, every time you initialise your new record for the new data add integer +=1 (is equal to integer := integer +1) set integer as the entry number, add your data and insert the record, you'll that it works.0
-
Sugeevishere wrote:@ Luc van Dyck Its compiling perfectly. But The output is not corrrect. It Starts with Zero and It won't moves above that. Stays with Zero.
Can You Provide me a Solution on this?recYourTable.LOCKTABLE; IF recYourTable.FINDLAST THEN intNextEntryNo := recYourTable."Entry No." + 1 ELSE intNextEntryNo := 1; recYourTable.INIT; recYourTable."Entry No." := intNextEntryNo; ...
If you don't show us your code, there is nothing we can do.
I could come over and hold your hands while you are typing the code, but then you'll have to take care of my travel costs.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)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