how to use Table ID in a CASE statement?

Mike_HWGMike_HWG Member Posts: 104
I have the following test code:
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 :cry:
Michael Hollinger
Systems Analyst
NAV 2009 R2 (6.00.34463)

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    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 Singleton
  • Mike_HWGMike_HWG Member Posts: 104
    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)
  • Mike_HWGMike_HWG Member Posts: 104
    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 #-o
    Michael Hollinger
    Systems Analyst
    NAV 2009 R2 (6.00.34463)
Sign In or Register to comment.