on 05-26-2016 7:37 AM
Hi,
I have created a line UDF(U_UnitPrice) in Inventory Transfer.
This UDF draws the value according to rules:
- If the IT is copied from ITR, it draws the value of U_UnitPrice of ITR.
- If the IT is standalone, it draws the value from a price list.
The query I used is:
case when (ISNULL($[$38.43.0], -1) > -1)
then select $[$38.U_UnitPrice.0]
else
select T0.[Price] FROM ITM1 T0
where T0.[ItemCode] = $[WTR1.itemcode] and T0.[PriceList] = 24
end
The value cannot be drawn.The error message is "Incorrect syntax near the keyword 'case'.
Please help!
Does any expert have idea about the query?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try below one of the query with select clause
select case when (ISNULL($[$38.43.0], -1) > -1)
then select $[$38.U_UnitPrice.0]
else
select T0.[Price] FROM ITM1 T0
where T0.[ItemCode] = $[WTR1.itemcode] and T0.[PriceList] = 24
end
OR
select case when (ISNULL($[$38.43.0], -1) > -1)
then select $[$38.U_UnitPrice.0]
else
select T0.[Price] FROM ITM1 T0
End
where T0.[ItemCode] = $[WTR1.itemcode] and T0.[PriceList] = 24
Thanks,
Harshal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try again with below one's.
select case when (ISNULL($[$38.43.0], -1) > -1)
then $[$38.U_UnitPrice.0]
else T0.[Price] FROM ITM1 T0
where T0.[ItemCode] = $[WTR1.itemcode] and T0.[PriceList] = 24
end
OR
Select case when (ISNULL($[$38.43.0], -1) > -1)
then $[$38.U_UnitPrice.0]
else T0.[Price] FROM ITM1 T0
End
where T0.[ItemCode] = $[WTR1.itemcode] and T0.[PriceList] = 24
Hope one of the above works now.
Thanks,
Harshal
Thanks, there are no syntax errors for the above query.
However, it fails to draw the value and return "0.00" in the UDF (U_UnitPrice) for both ITR copy to and standalone case.
Am I selecting the wrong field?
---------------------------
This UDF draws the value according to rules:
- If the IT is copied from ITR, it draws the value of U_UnitPrice of ITR.
- If the IT is standalone, it draws the value from a price list.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.