IBM Support

Rich Text data showing in COMMLOG table and in Reports (Script Solution)

Technical Blog Post


Abstract

Rich Text data showing in COMMLOG table and in Reports (Script Solution)

Body

When creating a communication from work order module or any other application, communication logs and email that was triggered are fine, but you may be noticing some rich text data when the record gets saved to the database (Commlog table).


You may also be noticing unwanted tags in the data in reports.

 

The Rich Text tags can be stripped from the field using an Object Launch point AutoScript.

 

1. Go to Automation Scripts app
2. Click Select Action and create a new Object Launch Point
3. The Object is COMMLOG
4. The events should be Add and Update.
5. Enter the variable as follow:

Variable -> MSG
Type -> INOUT
Binding Type -> Attribute
Binding Value -> MESSAGE

6. Add the following script

#-----------------------------------------------------------------------
from psdi.util import HTML
MSG = HTML.toPlainText(MSG)
#-----------------------------------------------------------------------

7. Save it and activate the automation script.
8. Send a new communication from Maximo and check the record in the database.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11112277