Showing posts with label scconfig. Show all posts
Showing posts with label scconfig. Show all posts

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()