Maximo List Archive

This is an archive of the Maximo Yahoo Community. The content of this pages may be a sometimes obsolete so please check post dates.
Thanks to the community owner Christopher Wanko for providing the content.

need help with yet another Automation Script

From: therron (2018-10-18 20:32)

Maximo 7.6

On PRLine, when the RequestedBy field is populated, I want it to crossover that person's Primary Email address to one of the built-in extra fields, PRLINE.PRLALN4. This then gets crossed over to POLINE.POLALN4 via legacy (v4.1.1 and before) hard-coded stuff. When this item gets received, we then have an Escalation email that address. It's built this way so the user can choose whether or not to get emailed. For example, if it's a part they are waiting on to finish a job, they probably want to get emailed so they can make a special trip over to Receiving to get it; if it's one of the Inventory Managers in the warehouse, who have offices right next to Receiving, it's probably easier for the Receiving clerk to wave the Inventory Manager down and tell him he has a package instead of sending potentially dozens of emails.

I built, and properly configured and deployed, a Crossover Domain to do this. It works great. . .IF you enter the value in RequestedBy manually. When creating a PR, Maximo wants to automatically set some values for you. If Maximo sets the value, the crossover isn't firing. So, if you:

1) Let the Reorder Cron create your PR, the Run As User as set in the cron becomes PR.REQUESTEDBY and PRLINE.REQUESTEDBY, but the crossover doesn't fire.

2) Duplicate an old PR (particularly, a PR that someone else created), your name becomes the PR.REQUESTEDBY and PRLINE.REQUESTEDBY, but the crossover doesn't fire. (Here, we ended up with a PR where one guy duplicated another guy's old PR, so the new PR had the other guy's email address, and the other guy was emailed upon Receipt.)

3) Type in your own PR from scratch. As you add rows, your userid becomes PRLINE.REQUESTEDBY but the crossover does not fire. You could change REQUESTEDBY to someone else, then put it back to yourself and the crossover works. But that's because you manually entered it.

4) Typing your own, but putting your personid in the Default Table Data section of the PR Lines tab. Same result as #3 above.

I opened a service request with IBM, they said this can only be solved by Automation Script, but I can't get it to work. I put this script as an Attribute Object Launch Point, Run Action type script (maybe I should have done Validate?):

from psdi.mbo import MboRemote
from psdi.mbo import MboConstants
from psdi.mbo import MboSetRemote
if prlaln4 is None and requestedby is not None:
personmboSet = mbo.getMboSet("$PERSON$")
primaryEmail = personmboSet.getString("PRIMARYEMAIL")
mbo.setValue("prlaln4", primaryEmail, MboConstants.NOVALIDATION)

Any ideas on what I missed?

Travis Herron

From: therron (2018-10-18 13:34)


This script was an ATTRIBUTE launch point, on the Requested By field. Got momentarily confused with another script I'm working on.