Newbie needs help with "A value or expression was expected."

bboo4d
Member Posts: 14
I have created the following code. I am just trying to return a variable in a report.
The two tables are the tables in my report the variable I am trying to get is in the main table and I want to use it on a line in the body of the secondary table.
IF [Item Ledger Entry]."Item No_" THEN BEGIN
PubDateV := [Item]."Publication Date";
End;
I get the error ""A value or expression was expected." For example
100
myvar
myvar = 100
Thanks for your help
The two tables are the tables in my report the variable I am trying to get is in the main table and I want to use it on a line in the body of the secondary table.
IF [Item Ledger Entry]."Item No_" THEN BEGIN
PubDateV := [Item]."Publication Date";
End;
I get the error ""A value or expression was expected." For example
100
myvar
myvar = 100
Thanks for your help
0
Comments
-
An IF..THEN statement expects a statement that can be evaluated to a Boolean. The statement "[Item Ledger Entry]."Item No_" cannot. You need to specify what [Item Ledger Entry]."Item No_" should be equal to.
Example
IF [Item Ledger Entry]."Item No_" = 'ITEM' THEN
...{do this]There are no bugs - only undocumented features.0 -
Or
If you are trying to see whether "Item No_" contains a value, use a function likeSTRLEN(String)
to check it
Ex:IF STRLEN([Item Ledger Entry]."Item No_") > 0 THEN BEGIN PubDateV := [Item]."Publication Date"; End;
There could be other ways also. Main point here is the IF statement expects a BOOLEAN result. TRUE or FALSE"A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."0 -
Thanks for the input guys, I have tried both methods and am still getting the error message.
Any other suggestions.
Barb0 -
Is this C/AL??? Why [Item Ledger Entry]."Item No_" and not
"Item Ledger Entry"."Item No." ??
Am I missing something?0 -
bboo4d wrote:Thanks for the input guys, I have tried both methods and am still getting the error message.
Any other suggestions.
Barb
Lets see your code & error messages. And I agree with kapamarou
I was wondering the same thing (syntax?).0 -
I'm trying to set in my report a expression depending of a boolean but i cant linked the expression to my global var aux.
proforma Boolean
aux Text
To turn around this problem I tried to create a column and with a/c code I set the column value depending of a boolean
anyone can help?
0 -
[Why didn't you start a new thread, instead of adding to a 9-year-old one?]
Is ReportTitle a Global Variable ? What type?
Jan Veenendaal0
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