Maximo Open Forum

 View Only
  • 1.  Saved Queries - Logged in User's DEFSITE

    Posted 2 hours ago
    Edited by Danny Richardson 2 hours ago

    I am wanting to create a public saved query that shows the below information, but that also determines the logged in user's defsite, so that the user only sees work orders pertaining to their site.

    This works correctly:  (woclass in ('WORKORDER','ACTIVITY')
      and historyflag = 0
      and istask = 0
      and worktype in ('MPM')
      and fnlconstraint >= timestamp(current date - (day(current date) - 1) days)
      and fnlconstraint < timestamp(current date - (day(current date) - 1) days + 1 month)

      and status != 'COMP'

    but when I add the siteid part below, it does resolve the correct userid but it seems to not be able to find defsite or return it as siteid, and it says 0 results.

    (woclass in ('WORKORDER','ACTIVITY')
      and historyflag = 0
      and istask = 0
      and worktype in ('MPM')
      and fnlconstraint >= timestamp(current date - (day(current date) - 1) days)
      and fnlconstraint < timestamp(current date - (day(current date) - 1) days + 1 month)
      and siteid = (select defsite
                      from maxuser
                     where userid = :user)
      and status != 'COMP'

    Is there a suggested way to pull the logged in user's default site?

    Thank you


    #Administration
    #Customizations
    #EndUser
    #EverythingMaximo
    #Reporting
    #Scheduling
    #WorkManagement

    ------------------------------
    Danny Richardson
    Maximo Administrator Manager
    Technimark LLC
    ------------------------------



  • 2.  RE: Saved Queries - Logged in User's DEFSITE

    Posted 55 minutes ago

    You wrote the query correctly, using the same process that mobile and others use to filter for the logged in user's default insert site. Outside of the user not having a default insert site (which I assume you've already checked), or their default insert site not having any work orders that match the rest of your criteria, I can't think of how this wouldn't return records. I would try and replace this with a literal value and see if you get records. For example, if your default insert site is BEDFORD, try to do:

    (woclass in ('WORKORDER','ACTIVITY')
      and historyflag = 0
      and istask = 0
      and worktype in ('MPM')
      and fnlconstraint >= timestamp(current date - (day(current date) - 1) days)
      and fnlconstraint < timestamp(current date - (day(current date) - 1) days + 1 month)
      and siteid = 'BEDFORD'
      and status != 'COMP'



    ------------------------------
    Steven Shull
    Naviam
    ------------------------------