Showing posts with label utility(). Show all posts
Showing posts with label utility(). Show all posts

Sunday, 27 December 2020

Delete a Person from a list of Person Groups (Dialog, Automation Script) | Maximo

A revised version of the existing post Delete a Person from Person Groups (LIST VIEW QUERY) using Automation Script | Maximo.

We are going to add a dialog box on the list view of Person Group Application to choose the Person to be deleted




1. New Non-Persistent Object with one attribute Personid

  • Object Name: NP_DELETE_PERSONID
  • Attribute:        NP_personid

Wednesday, 23 December 2020

Invoke/Call any dialog from Automation Script | Maximo

Question:
Can we invoke/call my custom dialog or any dialog from the automation script, like we usually can trigger it from the Push button or from Select Action of the application 

Answer:

Yes, you can in the latest version 7.6.1. 

1. Get the dialog name from the application designer 
2. using below mentioned automation script to call it. 

In my example, I created one object launch point automation on the work order application to trigger automation. 
Below is the body of the automation in which I called one of the standard change status dialogs. 


from psdi.server import MXServer
from psdi.mbo import MboConstants
from psdi.common.context import UIContext
from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent
mxServer = MXServer.getMXServer()
userInfo = mxServer.getUserInfo("maxadmin")
vmbo = mbo.getString("wonum")
if vmbo == '30352551':
    context = UIContext.getCurrentContext()
    if context:
        wcs = context.getWebClientSession()
        Utility().sendEvent(WebClientEvent("status", wcs.getCurrentPageId(), None, SessionContext(wcs)))
        #service.error("",str(abc))



To Close a dialog, either use "okdialog" or in the newer version in can be done with 1 line of code:

service.closeDialog()