STRINGLIKE CHARLIST (2 replies and 1 comment)
wmb, StringLike doesn't work like this.
Below is an expression which will do the job (there is definitely room for improvement here.
Dim Vals Dim l Dim Result Result = False Vals = Split("1,3,5,7,12,14,20,22,26,27", ",") For l = 0 to Ubound(Vals) If Vals(l) = %PktProfileID Then Result = True End If Next Result
Awesome - thank you so much.. Guess I need to learn more VB Scripting.
What a great support forum - always helpful.
I am reading data from an XML file in order to create orders in Sage 300 and I have a profile ID that I need to compare against a range of characters. If the profile ID is 1,3,5,7,12,14,20,22,26,27 then the value returned should be S otherwise it should be M.
I tried STRINGLIKE with a CHARLIST similar to this to start with:
IIF (StringLike(%PktProfileID) ,[1357]),"S","M")
and I get the following error: Line=1;Pos=36; Function [[1357]] is invalid.
If I put quotations around the 1357 I get the false part even though it should be true.
So how do I get this to compare a field to multiple values and return true if it is one of those values or false if not?