Showing posts with label personid. Show all posts
Showing posts with label personid. Show all posts

Thursday, 17 September 2020

Get PersonID of the Logged in User in Automation Script | Maximo

There are multiple ways  to get the person id in Automation script, one of the them is as below:

PersonSet = MXServer.getMXServer().getMboSet("MAXUSER", mbo.getUserInfo())

    PersonSet.setWhere("PERSONID=:&PERSONID&")

    vPerson = PersonSet.getMbo(0)

    service.error(user,vPerson.getString("personid"))

    PersonSet.save()

 

For Person ID: -                 :&PERSONID&

For Username  -                   :&USERNAME&

 

or we can also use the one of the implicit variable ( USER )fo the logged in user:

PersonSet = MXServer.getMXServer().getMboSet("MAXUSER", mbo.getUserInfo())

    PersonSet.setWhere("userID='" + user + "'");

    vPerson = PersonSet.getMbo(0)

    service.error(user,vPerson.getString("personid"))

    PersonSet.save()

Thursday, 26 November 2015

Default System Variables, Can be used to default a value - IBM Maximo

&SYSDATE& - This will default a field with the current system date/time
&USERNAME& - This will default a field to the current USERID value
&AUTOKEY& - This is used for attributes that are set to autonumber to default to the next autonumber value.
&PERSONID& - This will default the current user's PERSONID value.

How do I set field defaults in Maximo using Database Configuration? 
Solutions:
  
  1. Select the object the attribute exists in from Database Configuration Application
  2. Select the attribute for which the default is to be set
  3. Expand the details of the attribute
  4. In the right hand side of the Details section there is a Default field, type your desired default value 
OR
you can used system defaults (above given 4 variables) that work in the Database Configuration Default field.