Maximo Open Forum

 View Only
  • 1.  Do not update " changeby", "change date" values while data import

    Posted 12-20-2023 05:06

    Hi,

    We are updating asset description via data import flat files, in the process after importing the records, we find changeby is updated by our name and change date too.

    I understand that if we want to modify the changeby with 'MAXADMIN' we can add that in the sheet but Incase we  want to keep the changeby and change date fields same ( as it was before import) after import,what changes should we do in the object structure?


    #Administration
    #Analytics
    #Architecture
    #Assets
    #CivilInfrastructure
    #Customizations
    #EndUser
    #EverythingMaximo
    #HSE/OilandGas
    #Infrastructure
    #Integrations
    #Inventory
    #IoT
    #LifeScience/Calibration
    #Linear
    #MaximoApplicationSuite
    #MaximoForAviation
    #MaximoUserGroups
    #Mobility
    #Nuclear
    #Procurement
    #Reporting
    #Scheduling
    #Security
    #ServiceProvider
    #Spatial
    #Transportation
    #Utilities
    #WorkCenters
    #WorkManagement
    #MaximoVisualInspection
    #Predict
    #Monitor
    #Health
    #Assist
    #Safety

    ------------------------------
    Trisha S
    Tcs
    ------------------------------


  • 2.  RE: Do not update " changeby", "change date" values while data import

    Posted 12-20-2023 13:55

    Any time a field on the record is modified (whether it's via integration or the UI), the logic exists to update the changeby/changedate fields. This is done as part of the java class for Asset in the modify() method which cannot be suppressed. I am in strong favor of allowing these fields to update because the record has changed. If someone looked at the asset yesterday and it said "Centrifugal Pump" and tomorrow it said "RAM Truck" and the changeby & changedate about the asset indicates it hasn't changed, that would be confusing to the user. 

    If you really don't want this to happen for a given update, you either need to write an OSIN automation script (which would be restricted to a specific object structure) or an object launch point automation script on before save. You would need to get the previous value of the attribute and set them back to these fields.

    We talk about the OSIN Automation Script here: https://ibm-maximo-dev.github.io/maximo-autoscript-documentation/integration/osevents & object before save here: https://ibm-maximo-dev.github.io/maximo-autoscript-documentation/objectscripts/objectlaunch

    To get the previous value, you would want to do something like this:

    mbo.setValue("CHANGEBY",mbo.getMboValue("CHANGEBY").getPreviousValue().asString(),mbo.NOACCESSCHECK)

    mbo.setValue("CHANGEDATE",mbo.getMboValue("CHANGEDATE").getPreviousValue().asDate(),mbo.NOACCESSCHECK)


    If you do the OSIN launch point, you know that it's related to an integration. An object save launch point will fire for anything and there are times (such as cron tasks, escalations, etc.) where a record could be updated where the interactive flag is false. But I would recommend at a minimum checking that interactive is false like:

    if not interactive:

    before setting the values back



    ------------------------------
    Steven Shull
    IBM
    ------------------------------