|
Default Insert Site query
|
|
Replies:
3
-
Pages:
1
-
Last Post:
Nov 6, 2009 3:27 AM
Last Post By: magic_berny
|
Threads:
[
Previous
|
Next
]
|
|
Posts:
17
Registered:
Sep 25, 2009 09:42:01 AM
|
|
|
|
Default Insert Site query
Posted:
Nov 04, 2009 10:55:29 AM
|
|
|
|
Hi All,
I am trying to write a query that is dependant on the user default insert site.
I have users that have access to many sites and i need this query to avoid having to create one start center for each site. So that all they have to do to see work orders from a different site would be to change their default insert site
something along the line of (select * from workorder where siteid = defsite) using :&defsite& doesn't seem to work but again i might not be using it properly
any help will be much appreciated.
|
|
Posts:
7
Registered:
Oct 22, 2009 12:19:21 PM
|
|
|
|
Re: Default Insert Site query
Posted:
Nov 04, 2009 04:12:30 PM
in response to: magic_berny's post
|
|
|
|
The default insert site data is stored on the person record and table. You can write your query to pull form this table. The profile link at the top of the screen is just a short cut to this data.
|
|
Posts:
4
Registered:
Nov 19, 2008 01:56:39 PM
|
|
|
|
Re: Default Insert Site query
Posted:
Nov 05, 2009 10:31:56 PM
in response to: magic_berny's post
|
|
|
|
Berny,
The USERNAME variable can be used to select the current user's default site from the maxuser table. Here is an example of a SQL where clause that selects workorders from the user's default site:
woclass = 'WORKORDER'
and historyflag = 0
and istask = 0
and wopriority = 1
and status not in ('CLOSE','COMP','CAN')
and siteid = (select defsite from maxuser where userid = :&USERNAME&)
I use this query to show the active emergency workorders for the user's default site.
Matt
|
|
Posts:
17
Registered:
Sep 25, 2009 09:42:01 AM
|
|
|
|
Re: Default Insert Site query
Posted:
Nov 06, 2009 03:27:15 AM
in response to: matt_f's post
|
|
|
|
Thanks Matt,
that query works indeed and i found that
... and siteid =(select defsite from maxuser where userid = :USER).. also did the trick
Thanks again
|
|
|
|
|