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.iohttps://opqo.io------------------------------
Original Message:
Sent: Thu July 11, 2024 11:58 AM
From: Vineet Joshi
Subject: workorder long description not showing Image
Pictures in Long description helps identify each task rather than printing all the images at the end of the report
------------------------------
Vineet Joshi
Original Message:
Sent: Wed June 19, 2024 03:26 PM
From: suman kumar
Subject: workorder long description not showing Image
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
------------------------------