Maximo

 View Only
  • 1.  workorder long description not showing Image

    Posted Wed June 19, 2024 03:27 PM

    I have added text and a image(copy and paste) to workorder long description field. In longdescription table its showing html text for both text and image.

    Upon loading workorder again and checking longdescription field , its showing only text but not image.

    Same thing for Edge,chrome,IE and firefox. 

    Maximo version is 7.6.1.2.



    ------------------------------
    suman kumar
    ------------------------------


  • 2.  RE: workorder long description not showing Image

    Posted Mon June 24, 2024 10:21 AM

    Hi Suman, 

    Is there a reason why you are looking to add an image to the long description field instead of the native attachments field?



    ------------------------------
    Evan Williams
    ------------------------------



  • 3.  RE: workorder long description not showing Image

    Posted Fri July 12, 2024 09:21 AM

    Thank You everyone. It was driven by external system requirement. Issue is resolved with this tech note.

    Images not displayed in long description fields (ibm.com)

    Thanks,

    Suman



    ------------------------------
    suman kumar
    ------------------------------



  • 4.  RE: workorder long description not showing Image

    Posted Thu July 11, 2024 11:54 AM

    It does show up in browser but not in PDF. Is it not working for you in browser? if PDF is a problem then you can export the report to MS word. IBM needs to provide a fix for this. 



    ------------------------------
    Vineet Joshi
    ------------------------------



  • 5.  RE: workorder long description not showing Image

    Posted Thu July 11, 2024 11:58 AM

    Pictures in Long description helps identify each task rather than printing all the images at the end of the report 



    ------------------------------
    Vineet Joshi
    ------------------------------



  • 6.  RE: workorder long description not showing Image

    Posted Thu July 11, 2024 12:59 PM

    Here you go. It is writing Javascript and has the scriptConfig included 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
    ------------------------------