on 2014 Apr 10 2:52 PM
Hi - I have added a function button (Using Boyum) to BP Master Data. I want it to show me all AR DownPayment invoices for that particular BP. I saved the following SQL in a Universal Function:
SELECT T1.[DocNum], T0.[CardName], T0.[CardCode], T1.[DocDate], T1.[NumAtCard],
T1.[DocStatus]
FROM ODPI T0 INNER JOIN DPI1 T1 ON T0.CardCode = T1.CardCode
WHERE T0.[CardCode] = $[$5.0.0]
FOR BROWSE
But get this error:
Invalid query tree [300-33]. The SQL error is 8180: SQL: SELECT T1.[DocNum], T0.[CardName], T0.[CardCode], T1.[DocDate], T1.[NumAtCard],
T1.[DocStatus]
FROM ODPI T0 INNER JOIN DPI1 T1 ON T0.CardCode = T1.CardCode
WHERE T0.[CardCode] = 'test'
(Please note 'test' is the CardCode of the BP)
Advice is appreciated!
Thanks
Request clarification before answering.
Hi Tim
I think a couple of the T1's in your query should be T0's
(Docnum, [NumAtCard] and [DocStatus] dont appear to be in the DPI1 table, but are in the ODPI table)
Try this one(?)
SELECT T0.[DocNum], T0.[CardName], T0.[CardCode], T1.[DocDate], T0.[NumAtCard], T0.[DocStatus]
FROM ODPI T0 INNER JOIN DPI1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.[CardCode] = $[$5.0.0]
I haven't tried it on a function button though
Cheers
Vicky
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 17 | |
| 11 | |
| 8 | |
| 6 | |
| 6 | |
| 4 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.