Topic
  • 9 replies
  • Latest Post - ‏2013-07-20T17:42:19Z by Arun_Aviator
Arun_Aviator
Arun_Aviator
16 Posts

Pinned topic How to pass the current logged in user to the where class of Relationships in Maximo?

‏2013-07-03T17:56:57Z |

I need to create a relationship for an object in the database configuration application of maximo, wherein there is a need to get the result based on the current logged in user. how can I set this info in where class, I have tried :user , but it is not working. Please help

  • bgbaird
    bgbaird
    282 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-03T17:59:57Z  

    I use ":user" in lots of relationships.  To help out a bit, what is the parent, child, and clause you are trying yo use?

     

    Brian

  • Arun_Aviator
    Arun_Aviator
    16 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-03T18:04:20Z  
    • bgbaird
    • ‏2013-07-03T17:59:57Z

    I use ":user" in lots of relationships.  To help out a bit, what is the parent, child, and clause you are trying yo use?

     

    Brian

    Hi Brian,

    I am trying to use it in 'WORKORDER' object and the child is 'WPMATERIAL".

    I have used :user in some conditional expressions attached to 'SIGOPTIONS' , it worked fine, but not with relationships.

     

    Thanks

    Arun

  • Arun_Aviator
    Arun_Aviator
    16 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-03T18:14:31Z  

    Hi Brian,

    I am trying to use it in 'WORKORDER' object and the child is 'WPMATERIAL".

    I have used :user in some conditional expressions attached to 'SIGOPTIONS' , it worked fine, but not with relationships.

     

    Thanks

    Arun

    This is the clause, I tried &personid&. no luck

    (locationin((selectlocationfromlocationswhereinvowner ='&personid&')andsiteid=:siteid)

    or(:owner ='&personid&')

    or(:reportedby ='&personid&')

    or(:status ='INPRG'and:owner isnull))

  • bgbaird
    bgbaird
    282 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-03T18:48:40Z  

    This is the clause, I tried &personid&. no luck

    (locationin((selectlocationfromlocationswhereinvowner ='&personid&')andsiteid=:siteid)

    or(:owner ='&personid&')

    or(:reportedby ='&personid&')

    or(:status ='INPRG'and:owner isnull))

    This may sound silly, do you have any spaces in you where clause?  They aren't in the post above.

  • bgbaird
    bgbaird
    282 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-03T18:57:01Z  
    • bgbaird
    • ‏2013-07-03T18:48:40Z

    This may sound silly, do you have any spaces in you where clause?  They aren't in the post above.

    The relationship between workorder and wpmaterial is pretty well set.  What different wpmaterial records are you trying to include/exclude?

     

    It also helps me a lot to start out small, then add pieces. 

     

    :reportedby = :userid

    get it working, then add :owner = :userid

     

  • Arun_Aviator
    Arun_Aviator
    16 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-04T03:23:59Z  
    • bgbaird
    • ‏2013-07-03T18:57:01Z

    The relationship between workorder and wpmaterial is pretty well set.  What different wpmaterial records are you trying to include/exclude?

     

    It also helps me a lot to start out small, then add pieces. 

     

    :reportedby = :userid

    get it working, then add :owner = :userid

     

    Thanks Brian, I will run with your suggestion and check if it works.

     

    The logic I am trying to bring in is, I want to attach this relationship to the  Materials Table under the Plans tab of workorder by replacing the current table relationship, by means of it,

    I will be showing the records which has the storeroom where the current logged user is set as the Inventory owner.

    or if the logged in user is the owner of the workorder or the reportedby then ill be showing all the planned material rows. That is why I am passing the current logged in user value. But I was not sure through which variable I can pass it.

  • Arun_Aviator
    Arun_Aviator
    16 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-13T09:36:46Z  

    Thanks Brian, I will run with your suggestion and check if it works.

     

    The logic I am trying to bring in is, I want to attach this relationship to the  Materials Table under the Plans tab of workorder by replacing the current table relationship, by means of it,

    I will be showing the records which has the storeroom where the current logged user is set as the Inventory owner.

    or if the logged in user is the owner of the workorder or the reportedby then ill be showing all the planned material rows. That is why I am passing the current logged in user value. But I was not sure through which variable I can pass it.

    :user worked great :)

  • QiupingMao
    QiupingMao
    6 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-13T17:53:54Z  

    :user worked great :)

    username and personid could be  same or different in maximo, depend on the field, you can use, the blog entry should help.

    :&PERSONID&

    It resolves to the person id of the current logged in user.

    :&USERNAME&

    It resolves to the current log in user name.

     https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/special_kind_of_maximo_bind_variables13?lang=en

  • Arun_Aviator
    Arun_Aviator
    16 Posts

    Re: How to pass the current logged in user to the where class of Relationships in Maximo?

    ‏2013-07-20T17:42:19Z  

    Thanks a lot :)  that really helps.