USERID not returning value

lloydf
Member Posts: 73
I have added a userid field to the comment line table so that I can store the userid of the user who added the comment.
I ammended the SetUpNewLine function however the USERID function does not return any value.
Any advice as to how I may acheive this would be much appreciated.
SetUpNewLine()
CommentLine.SETRANGE("Table Name","Table Name");
CommentLine.SETRANGE("No.","No.");
CommentLine.SETRANGE(Date,WORKDATE);
IF NOT CommentLine.FIND('-') THEN BEGIN
Date := WORKDATE;
UserID:=USERID;
END
I ammended the SetUpNewLine function however the USERID function does not return any value.
Any advice as to how I may acheive this would be much appreciated.
SetUpNewLine()
CommentLine.SETRANGE("Table Name","Table Name");
CommentLine.SETRANGE("No.","No.");
CommentLine.SETRANGE(Date,WORKDATE);
IF NOT CommentLine.FIND('-') THEN BEGIN
Date := WORKDATE;
UserID:=USERID;
END
0
Comments
-
Navision is not case sensitive. So USERID is interpreted by the compiler as UserID field from Rec.
I suggest changing the field to "User ID". Notice the blank space before ID.0 -
I'm surprised that it doesn't error out when you try to assign a system variable.0
-
The field name has higher priority than Keyword it means that it is assigning the field into itself, not the system variable into system variable...0
-
Use:
UserID:=DATABASE.USERID;
0 -
It's bad practice to name fields after reserved words. Standard Navision uses "User ID". I would rename the field.0
-
ara3n wrote:Navision is not case sensitive. So USERID is interpreted by the compiler as UserID field from Rec.
I suggest changing the field to "User ID". Notice the blank space before ID.
"User ID" := USERID;
That's what we use too.
I just seems logical that this be standard.
I know you can Zoom, but why?
In fact we've addedEnabled Field No. Field Name Data Type Length Description Yes 50001 User ID Code 20 Yes 50002 User Name Text 30
Why look at the code when you can see the name O:)
Here's an easy one MS Forum Members!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