Parameters Question
Augusto Silva
Hi all,I copied coresuite example ( Sales Documents SAR06000 ) and changed the query to this:
"SELECT * FROM dbo.[OCRD] PN
WHERE PN.CardCode = '[%FromCardCode]' or (CASE WHEN '[%FromCardCode]'='' THEN PN.CardCode END = PN.CardCode)"
If i don't select any customer the designer works with no problem. If i select one customer no problem.
If i select two customers i have a system message
"swiss LD : Query : Ocrd has an error. An expression of non-boolean type specified in a context where a condition is expected, near 'OR'.
SELECT * FROM dbo.[OCRD] PN
WHERE (PN.CardCode = 'f0001' or PN.CardCode = 'c0001' ) or (CASE WHEN ('f0001' OR 'c0001' ) ='' THEN PN.CardCode END = PN.CardCode)
Sales Documents SAR06000 also doesn't work if i select two or more customers.
What is the problem with the Query? In parameters is it possible to select two or more values?
Best regards,
Augusto Silva
Philipp Knecht
Hi AugustoWhen choosing multiple parameters cld needs to parse the sql string and insert the appropriate logic.
If the parameter in the query gets asked like : ...where CardCode = '[%CardCode]' then it'll work.
In this case the query has a complex structure which make the cld parser fail.
I'll examine the usage and maybe i can come up with a generic solution for this issue.
Elsewise we need to change the underlying query.
hth
Augusto Silva
Hi Philipp,Thank you for your answer.
If you get a solution for this issue let me know.
Augusto Silva
0
Please sign in to leave a comment.
Comments
0 comments