Maximo

 View Only

 Customizing the list shown in a "Select Value" dialog

Jump to  Best Answer
BRIAN BULLA's profile image
BRIAN BULLA posted 05/28/26 08:31 AM

Hi,

I'm trying to automatically filter down a list displayed to the users when they create a new Communication on a Work Order.  I am trying this with an Automation Script, but no luck yet.  Here is what I am doing:

1.      Go to Work Order Tracking (Tr) application

2.      Under Actions, select Create – Communication

3.      On the Create Communication dialog, click on the chevron beside “Template” and choose “Select Value”

4.      Here we need to filter the list to only show Templates for “Transit” users.  (ie. LIKE “TR-%”)


A screenshot of a computer

AI-generated content may be incorrect.

Initially the list shown has about 34 Templates to choose from, but the users needs to type “TR-“ in the filter to see only what is applicable for them.  I would like to implement an automation script to filter this list.  Is this possible?

So far I have tried creating one on the INIT event of the COMMTEMPLATE object with the following:

To only run the script for “TRANSIT” users I use an Object Event Condition = :&PERSONID& IN (SELECT personid FROM person WHERE cgdivision = 'TRANSIT')

The script to filter the list:

mboSet = mbo.getThisMboSet()
mboSet.setWhere("templateid LIKE 'TR-%'")
mboSet.reset()

But when I activate this automation, all I get is a blank list.  Can anybody see where I am going wrong here??

If I run the following SQL against my database, I get the results I am looking for:

A screenshot of a computer

AI-generated content may be incorrect.

Thanks,

Sankar Ganesh V S's profile image
Sankar Ganesh V S IBM Champion  Best Answer

Hi Brain,

As suggested by 'Sawan Mahajan', this can be done by 'Retrieve list'- 'Attribute' launch point 
However, we could also achieve this by with  'Security restriction' at Group or Global level.
Here are the steps.

Create Conditon:

  • Go to 'Conditional Expression Manager'
  • Click new row. Enter the following details
    • Condition: <Enter Conditon name>
    • Type: EXPRESSION
    • Expression: templateid like 'TR-%'


Security Restriction:

  • Go to Security Group application
  • Select the 'Security group' 
  • Go to 'Data Restriction', --> 'Object Restrictions'.
  • Click new row under 'Object Restrictions'.
    • Object: COMMTEMPLATE
    • Application: WOTRACK
    • Type: QUALIFIED
    • Condition: <Condition Created from above step>
  • Save

You can also try 'Global Date Restricions' from List tab with condition for security group
Condition: exists (select 1 from groupuser where groupname in ('GROUP-A') and userid=:&USERNAME&)

Hope this helps!

Thanks!

sawan mahajan's profile image
sawan mahajan

Object level script are not working because lookup is overriding it.

you can use below steps to achieve the requirement:

  1. Create a table domain 

            object: COMMTEMPLATE

             list where clause: templateid LIKE 'TR-%

             validation where clause: templateid LIKE 'TR-%

      2. Create attribute launch point to attached the domain id dynamically (i am not checking person cgdivision in below script please add it)

              Object: COMMLOG

              Attribute: TEMPLATEID 

              event: retrieve list

              code: 

                current_app = mbo.getThisMboSet().getParentApp()

                if current_app == "WOTRACK":

                    domainid="MJN_TR_ONLY_DOMAIN"

           

I hope this will work for you.