how to use Table ID in a CASE statement?

Mike_HWG
Member Posts: 104
I have the following test code:
If I call Foo(DATABASE::Customer), a message prints 'Passed is 18, Customer is 18'. However, the debugger skips past the CASE statement instead of entering SomeOtherFunction(). What am I doing wrong?
I have also tried the following:
-Changing the definition of the function to Foo(TableID : Option)
-Casting TableID to a RecordRef and using the RecordRef in the CASE statement
-Changing the code to read CASE TRUE OF TableID = DATABASE::Customer
Nothing seems to be working
Foo(TableID : Integer) MESSAGE('Passed is %1, Customer is %2',TableID,DATABASE::Customer); CASE TableID OF DATABASE::Location: SomeFunction(); DATABASE::Customer: SomeOtherFunction(); END;
If I call Foo(DATABASE::Customer), a message prints 'Passed is 18, Customer is 18'. However, the debugger skips past the CASE statement instead of entering SomeOtherFunction(). What am I doing wrong?
I have also tried the following:
-Changing the definition of the function to Foo(TableID : Option)
-Casting TableID to a RecordRef and using the RecordRef in the CASE statement
-Changing the code to read CASE TRUE OF TableID = DATABASE::Customer
Nothing seems to be working

Michael Hollinger
Systems Analyst
NAV 2009 R2 (6.00.34463)
Systems Analyst
NAV 2009 R2 (6.00.34463)
0
Comments
-
have a look at the Navigate Form, that function was added just for that form, so that is sort of the reference on how to use it.David Singleton0
-
hmm, looks like they are using numeric literals, but it still isn't working for me.Michael Hollinger
Systems Analyst
NAV 2009 R2 (6.00.34463)0 -
Bah, I was running a slightly different set of code and I wasn't waiting for it to process. My original code works if it wasn't for tester error #-oMichael Hollinger
Systems Analyst
NAV 2009 R2 (6.00.34463)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