Sunday 29 November 2020

Refresh/Update Start Center for All Users in a specific Security Group | Maximo

 Create an automation script to delete the records from the respected table to refresh the start centers displayed on the user's screen

or delete the records from the tables using SQL.

Today we are going to make an automation script and attached it to a signature option on the toolbar. 

So that whenever the user clicks on this button on the security group application, all the respected records will be deleted, and the start center will try to create new records, which means our records will be updated. 


This:

1. Create an Action Launch Point Automation Script with a name like( STARTCENTER_REFRESH ).

Copy the below code in the script section, use jython as language. 

from psdi.server import MXServer

from psdi.mbo import MboConstants

from psdi.util.logging import MXLoggerFactory


logger = MXLoggerFactory.getLogger("maximo.maximodev")

logger.info("Entering MXD_RESETSC")


def deleteSc(objectName, where):

    scSet = MXServer.getMXServer().getMboSet(objectName, mbo.getUserInfo())

    scSet.setWhere(where)

    logger.debug("Deleting " + str(scSet.count()) + " rows from " + objectName)

    # disable logging of large fetch result set to avoid FetchResultLogLimit errors

    scSet.setLogLargFetchResultDisabled(True)

    scSet.deleteAll()

    scSet.save()


grpname = mbo.getString("GROUPNAME")


where1 = "scconfigid IN (SELECT scconfigid FROM scconfig WHERE groupname='" + grpname + "')"

where2 = "layoutid IN (SELECT layoutid FROM layout WHERE " +where1+ ")"


deleteSc("RSCONFIG", where2)

#deleteSc("FACONFIG", where2)

deleteSc("INBXCONFIG", where2)

deleteSc("KPILCONFIG", where2)

deleteSc("KPIGCONFIG", where2)

#deleteSc("ACTIONSCFG", where2)

deleteSc("PORTLETDISPLAY", where2)

deleteSc("LAYOUT", where2)

deleteSc("SCCONFIG", where1)

2. Now open security group application in Application Designer

a. create a new Security Group and name it the same as you gave to the Action Automation Script. In my case my action automation script name is  STARTCENTER_REFRESH. Therefore, my security option name is also STARTCENTER_REFRESH,

b. In the advanced settings of Signature Option, use this option.

This is an action that must be invoked by the user in the UI




b. Create a new Toolbar Option and give it the same name: STARTCENTER_REFRESH.

c. Choose the Type

No comments:

Post a Comment