Anybody succeeded in using a variable with a IN statement?
Sort of IF AnyRecord.Field IN [TextVariable] THEN ...
where TextField should contain something 'VALUE1,VALUE2,VALUE3'.
IF SomeVar IN [TextVariable] THEN ... has no chance to work. You can try to think of IN operator as a series of ORs on every argument inside the square brackets. In your case IF SomeVar IN [TextVariable] THEN... is equivalent to IF SomeVar = TextVariable THEN... as you have only one argument inside the square brackets.
Without restoring to .NET you can write a function performing the check, someting like this:
Contains(aVar, aList)
{
EXIT(
(aVar = aList)
OR (STRPOS(aList, aVar+',') = 1)
OR (STRPOS(aList, ','+aVar+',') > 1)
OR (STRPOS(aList, ','+aVar) = STRLEN(aList) - STRLEN(aVar) )
)
}
Answers
Without restoring to .NET you can write a function performing the check, someting like this:
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Pacific City, OR