Maximo

Maximo

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

 View Only
  • 1.  Appending Information from a Field in WO to a field in Asset

    Posted Wed July 10, 2024 10:26 AM

    Hello all,

    in Asset, we are adding a new field as ASSET.SERVICENOTES, with Long Description.

    In Work Order, we are also adding a new as WORKORDER.SERVICENOTES, with Long Description.

    The requirement is that when any Service Notes are entered in WORKORDER.SERVICENOTES and WO status is changed to COMP, then WONUM, the status change date and value of WORKORDER.SERVICENOTES is appended to the Long Description ASSET.SERVICENOTES at the top as per the following format.

    Work Order: 123456

    WO Completion Date: Status Change Date 

    Service Notes:

    This is the Service Note

    this same thing is done for every WO, where Service Notes is entered. If not entered, then this is not done.

    Any idea how to do that? 

    I am of the view of an Automation Script... 
    If this is correct then can someone help with Automation Script... especially with Formatting...

    Else... any other Idea

    Note that having a field and displaying it on WORK tab of Asset... is not an option...



    ------------------------------
    mx pro
    ------------------------------


  • 2.  RE: Appending Information from a Field in WO to a field in Asset

    Posted Thu July 11, 2024 11:56 AM

    That would become a super large field over time.  Wouldn't that exceed some database data field limit?

    I needed something like this and we went with a report instead.  From the asset record, we hit the report shortcut icon we added to the top menu bar.  It queries using the asset number of the record you're in and it returns a list of all the WOs, finish date, and their log entries.  The log entries is what the guys wanted to see, so they could read everything on one scrolling page rather than clicking into each WO to read the notes.  You could design your report to pull in WONUM, ACTFINISH, SERVICENOTES.



    ------------------------------
    Gail Smith
    Senior CMMS Specialist
    Marine Fleet Technical - Chevron
    ------------------------------



  • 3.  RE: Appending Information from a Field in WO to a field in Asset

    Posted Fri July 12, 2024 03:06 PM

    Gail.  Your solution is an excellent and practical idea!  Any chance you can share a copy of it with me to see its content and organization.  Did you use BIRT?  This would be a huge value add for our Technicians. 



    ------------------------------
    Nancy Powers
    ------------------------------



  • 4.  RE: Appending Information from a Field in WO to a field in Asset

    Posted Fri July 12, 2024 04:50 AM

    I agree that appending to a long description could get troublesome and also not ideal. 

    Have you considered using the WORKORDER Log Notes - adding a new LOG Type = 'SERVICENOTE'

    Then on the Asset Application creating a new Tab that has a relationship to the WORKLOG object where the recordkey and siteid is equal to workorder for the Asset record and the LOGTYPE = 'SERVICENOTE'.

    To simplify this It may also be worth looking at creating a new view that selects these WORKLOG entries combined with WONUM, ASSETNUM etc and then the relationship to for the ASSET object would be to this view and be far easier to create.

    This means from the Asset you can then review all the SERVICE Notes but listed in a table that could be ordered by entered date etc

    All of the above could be done using basic configuration and not require any Automation scripting.



    ------------------------------
    Steve Lee
    Maximo Technical Sales Specialist
    IBM
    Leeds
    ------------------------------



  • 5.  RE: Appending Information from a Field in WO to a field in Asset

    Posted Fri July 12, 2024 09:23 AM

    i think you are right

    thanks for info



    ------------------------------
    ramadan Richter
    jas
    Cairo
    01012998326
    ------------------------------



  • 6.  RE: Appending Information from a Field in WO to a field in Asset

    Posted Fri July 12, 2024 09:56 AM
    Edited by John Q. Todd Fri July 12, 2024 09:58 AM

    The solution (by Steve Lee) was exactly what came to my mind when I read the use case... and we have done this a few times for a client. Making use of the OOB Work Log functionality is quite valuable. An excellent approach.



    ------------------------------
    John Q. Todd
    Sr. Business Consultant
    Total Resource Management
    ------------------------------



  • 7.  RE: Appending Information from a Field in WO to a field in Asset

    Posted Fri July 12, 2024 10:00 AM

    I tend to agree with the other responses that there may be a better way to address you need.  But, assuming that you want what you expressed, here is a solution.

    This includes the scriptConfig so you can deploy it from VS Code.

    https://marketplace.visualstudio.com/items?itemName=sharptree.maximo-script-deploy

    main();
    
    function main(){
        // safety checks to make sure we have an implicit Mbo object and that it is based on the WORKORDER object.
        // also check that the ASSETNUM field is not null    
        if(typeof mbo !== 'undefined' && mbo!=null && mbo.isBasedOn("WORKORDER") && !mbo.isNull("ASSETNUM")){        
            // if the status has been changed and it is now COMP
            if(mbo.getMboValue("STATUS").isModified() && mbo.getString("STATUS") == "COMP"){
                
                // remove the previous Rich Text formatting tag 
                var assetNotes = mbo.getString("ASSET.SERVICENOTES_LONGDESCRIPTION").replaceAll("<!-- RICH TEXT -->", "");
                
                var notes = "<p style=\"caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-family: Arial, Helvetica, sans-serif; font-size: 17.6px;\">" 
                + "<strong>Work Order:</strong>" + mbo.getString("WONUM") + "</p>"
                + "<p style=\"caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-family: Arial, Helvetica, sans-serif; font-size: 17.6px;\">"
                + "<strong>WO Completion Date:</strong>" + mbo.getString("STATUSDATE") + "</p>"
                + "<p style=\"caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-family: Arial, Helvetica, sans-serif; font-size: 17.6px;\">"
                + "<strong>Service Notes:</strong></p><div>" + mbo.getString("SERVICENOTES_LONGDESCRIPTION") +"</div>"
                + "<!-- RICH TEXT -->"
            
                mbo.setValue("ASSET.SERVICENOTES_LONGDESCRIPTION", assetNotes + "<p></p>" + notes);
                
            }
        }
    }
    
    
    var scriptConfig={
        "autoscript": "WORKORDER.SERVICENOTES.COMP",
        "description": "Copy service notes on completion.",
        "version": "1.0.0",
        "active": true,
        "logLevel": "ERROR",
        "scriptLaunchPoints": [
            {
                "launchPointName": "WORKORDER.SERVICENOTES.COMP",
                "launchPointType": "OBJECT",
                "active": true,
                "description": "Copy service notes on completion.",
                "objectName": "WORKORDER",
                "save": true,
                "add": true,
                "update": true,
                "delete": false,
                "beforeSave": true
            }
        ]
    };


    ------------------------------
    Jason VenHuizen
    https://sharptree.io
    https://opqo.io
    ------------------------------