Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  How to find if the record is updated by maximo anywhere in Maximo

    Posted Wed November 03, 2021 02:19 PM
    We have an attribute that gets updated in Maximo from anywhere as well as from other system. Is there any way we can know that the record is updated by Maximo Anywhere.

    ------------------------------
    Panda 76
    ------------------------------



    #MaximoAnywhere
    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: How to find if the record is updated by maximo anywhere in Maximo

    Posted Thu November 04, 2021 10:21 AM
    Edited by System Admin Tue August 22, 2023 04:37 PM
    My organization did something similar. I wasn't directly involved, so I might be missing something.


    Objective:
    Determine if a WO was edited in Anywhere -- to prevent anywhere users from changing the classification of a WO.

    1. Create a non-persistent field in WORKORDER called CGANYWHERE.

    2. Create an OSLC automation script to populate CGANYWHERE (indicating if an update came from Anywhere or not):


    '''
    Script: OSIN.OSLCWODETAIL
    Description: This automation script will be used to set CGANYWHERE non-persistent field to indicate WO update came from Anywhere
    Language: python
    Details:  This automation script will be used to set CGANYWHERE non-persistent field to indicate WO update came from Anywhere
    
    Launch Points:
    Integration User Exit Launch Point: OSIN.OSLCWODETAIL
    
    from psdi.util.logging import MXLogger
    from psdi.util.logging import MXLoggerFactory
    '''
    
    mxLogger = MXLoggerFactory.getLogger('maximo.script.cust.OSIN.OSLCWODETAIL')
    if mxLogger.isInfoEnabled():
            mxLogger.info('Inside automation script: OSIN.OSLCWODETAIL')
    
    def beforeMboData(ctx):
        
        mbo = ctx.getMbo();
        
        if mbo and mbo.getName()=='WORKORDER':
    
            mbo.setValue("CGANYWHERE",True);


    3. Create a WORKORDER automation script that will throw an error if the classification changed and the update came from Anywhere:


    '''
    Script: VALIDATECLASSIFICATIONCHANGE
    Description: Automation Script used to validate a CLASSIFICATION Change on Work Order 
    Language: jython
    
    Details:  
    
    For Work Orders:
       1. Don't allow the CLASSIFICATION to change if the [update came from Anywhere].   
       
    Launch Points:
       1. WORKORDER.CLASSSTRUCTUREID - Validate
    '''
    
    from psdi.util.logging import MXLoggerFactory
    
    mxLogger = MXLoggerFactory.getLogger('maximo.script.cust.VALIDATECLASSIFICATIONCHANGE')
    
    if mbo.getName() == 'WORKORDER':
    	mxLogger.info('VALIDATECLASSIFICATIONCHANGE called for WORKORDER.')
    
    	
    	# Don't allow the CLASSIFICATION to be changed from Anywhere
    	status = mbo.getTranslator().toInternalString('WOSTATUS', mbo.getString('STATUS'), mbo)
    	if status not in ('WAPPR') and mbo.getBoolean('CGANYWHERE'):
    		errorgroup ='cgwo'
    		errorkey = 'cannotChangeCLASSIFICATION'
     
    mxLogger.info('VALIDATECLASSIFICATIONCHANGE done.')







    #Maximo
    #AssetandFacilitiesManagement
    #MaximoAnywhere


  • 3.  RE: How to find if the record is updated by maximo anywhere in Maximo

    Posted Thu November 04, 2021 10:28 AM
    Related post here: Way to determine if WO was created in Anywhere or Desktop?


  • 4.  RE: How to find if the record is updated by maximo anywhere in Maximo

    Posted Fri November 05, 2021 10:31 AM
    Thanks

    ------------------------------
    Panda 76
    ------------------------------