Easy Functions - Command
Marcel
Hi,I want to use the new Easy Functions.
I tried it and for example the set a new background color works fine. But I want to set a value in a UDF in a new Sales Order after I've entered the Customer number.
I tried these three alternatices:
SQLQuery("Dispatch|SELECT T0.U_Dispatch FROM dbo.OCRD T0 WHERE T0.CardCode = $[$4.0.0]")
ViewData("Dispatch")
SetData("$[$U_Dispatch.0.0]|Dispatch")
---
SQLQuery("Dispatch|SELECT T0.U_Dispatch FROM dbo.OCRD T0 WHERE T0.CardCode = $[$-4.0.0]")
ViewData("Dispatch")
SetData("$[$U_Dispatch.0.0]|Dispatch")
---
SQLQuery("Dispatch|SELECT T0.U_Dispatch FROM dbo.OCRD T0 WHERE T0.CardCode = [$ORDR.CardCode]")
ViewData("Dispatch")
SetData("$[$U_Dispatch.0.0]|Dispatch")
------
ViewData("Dispatch") is only during the test phase --> But I can see that "Dispatch" is every time empty.
What is my fault?
Marcel
Anders Olsson
Hi Marcel,I tried your first example and it works if you put single quotes around $[$4.0.0] in the query (as OCRD.CardCode is an nvarchar column).
SQLQuery("Dispatch|SELECT T0.U_Dispatch FROM dbo.OCRD T0 WHERE T0.CardCode = '$[$4.0.0]'")
Regards,
Anders
Marcel
Hi Anders,thanks for your help. Works fine.
Best regards
Marcel
0
Please sign in to leave a comment.
Comments
0 comments