on 02-27-2011 3:15 PM
Hi All,
I have a query that will get the the 'Doctotal', 'DocNum', and 'Docdate' from oinv
The requirements are the following:
1. I have two users, UserA and UserB
2. If UserA is currently login, the query will retrieve the data according to her login. And not supposed to see the sales of UserB.
3. If UserB is currently login, then vice versa.
rgds,
vin
If you use crystal report, you need to add usercode parameter to the selection formula.
But if you just use it in query, as stated, you can get the current login user data in a formatted search that you run in an active document.
Hope it helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A query activated from the Qury Manager does not get the information who activated it.
The $\[user] returns the code of the actual user only if it is executed in a formatted search! (Or if you activate it by the Tools/Queries/User Queries menu when a document is active). It does not get the identifier value if the query is activated from
the query manager.
So if you want your query dependent on the activating user, you should activate it as an FS (or the above mentioned manner).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try:
SELECT T0.Doctotal, T0.DocNum, T0.Docdate from oinv T0
INNER JOIN oSLP T1 ON T1.SlpCode = T0.SlpCode
WHERE T1.UserSign= $[user\]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Are they sales employees or document owners?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.