I want to do something like this:
CASE SalesLine.GETFILTER("Document Type") OF
FORMAT(SalesLine."Document Type"::Order):
// Do stuff
END;
Let's say I set a filter of Order and run the code. The above doesn't ever evaluate to true because GETFILTER returns 'Order' and the FORMAT returns '1'.
How do I do a correct evaluation? ](*,)
Answers
RIS Plus, LLC
Systems Analyst
NAV 2009 R2 (6.00.34463)
RIS Plus, LLC
try this
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Even better. :thumbsup:
Microsoft Dynamics NAV Classic
1
OK
None of them show the text representation of the option field. By this time I would have lost patience and just hardcoded the value
RIS Plus, LLC
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Mine works
Note to self.. Pressing F11 in a browser doesn't compile
But that is an entirely different issue CASE can't ever work like a filter. No matter what you would need to break up the comma string. I think you are confusing two different problems into one. I have shown you how to solve the question you asked, now you need to address the next one. I can see plenty of ways to solve it. For a small number of options like yours I would create an Array or options, for a larger selection I would use a temporary table.
Umm... I don't think I'm getting it, because this gives me '1' as well:
Systems Analyst
NAV 2009 R2 (6.00.34463)
I see now that the post I replied to before was not yours. I think Mberger has just taken the whole thread down a completely different direction and added confusion.
To MBerger, a CASE command can NOT handle multiple valid options, it gets to the first one then exits.
Mike if all you want is what you asked in your original post then my code does exactly what you want.