FINDLAST issue
lisakins
Member Posts: 23
I have made the Interaction Log Entry table in NAV 4.0 (SQL 2000) editable so that the salesmen can enter directly into a tabular form.
Because I do not wish to affect any other functions, I have created a new form that is on the contact card and shows the editable form where the profile answers usually are.
I get an error as soon as any field is clicked to initiate a new entry, because the entry no. is 0.
I am attempting to have the entry no, increment to the next available when they access this form. I put the following code in the OnActivate trigger:
IF InteractionLogEntry.FINDLAST THEN BEGIN
"Entry No.":=InteractionLogEntry."Entry No."+1;
I am receiving an error when I try to compile that states, "You have specified an unknown variable FINDLAST Define the variable under 'Global C/AL Symbols'.
This wasn't what I expected, but I'venever used the FINDLAST function before.
Can someone explain how I can correct this error and capture the last Entry No. + 1 on new records?
Because I do not wish to affect any other functions, I have created a new form that is on the contact card and shows the editable form where the profile answers usually are.
I get an error as soon as any field is clicked to initiate a new entry, because the entry no. is 0.
I am attempting to have the entry no, increment to the next available when they access this form. I put the following code in the OnActivate trigger:
IF InteractionLogEntry.FINDLAST THEN BEGIN
"Entry No.":=InteractionLogEntry."Entry No."+1;
I am receiving an error when I try to compile that states, "You have specified an unknown variable FINDLAST Define the variable under 'Global C/AL Symbols'.
This wasn't what I expected, but I'venever used the FINDLAST function before.
Can someone explain how I can correct this error and capture the last Entry No. + 1 on new records?
0
Comments
-
Findlast command only works with version 4.0 SP2 forward.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Does the Find command work in 4.0 (SQL2000)?
If so, would I put something like:
IF InteractionLogEntry.FIND(+) THEN BEGIN
"Entry No.":=InteractionLogEntry."Entry No."+1;0 -
Yes, that will work.
Since you're using SQL, it's highly recommended that you upgrade your executables to at least 4.0 SP3 and up.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
I did that and received the following error when I tried to compile:
"A value or expression was expected"
It then goes to the area of the code just after the + in the
FIND(+) THEN BEGIN
section.
Any ideas?0 -
I think your code should read
IF InteractionLogEntry.FIND('+') THEN BEGIN
"Entry":=InteractionLogEntry."Entry No."+1
End;
The key bit it is complaining about is the (+) not being ('+')
regards
IanRegards
Ian0 -
Good catch Ian... I didn't even realize that ' was missing... :oops:Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
That was it exactly!
Thank you both for all your help.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 326 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
