Saturday, 28 June 2025

Conditionally Hide the Table Columns in the List tab of an application in Maximo

The objective is to hide a table column (in our example: "Loop Location" field in Assets Application) from the list tab.



Steps:

1. Navigate to the application designer, open up the record for Asset Application.

2. Click on the "Add/Modify Signature Options" from the Select Action Menu.

3. Click on "New Row" in the dialog box that appears and create a new entry. In our example, I have created C_HIDE.


4. Click on "OK" button and close the dialog box.

5. Click on the field that you intend to conditionally display / hide and open up the properties. In our example, we are opening the properties of "Loop Location" field.


6. Click on the "Advanced" tab on the properties window. 
7. Click on the lookup icon against the "Signature Option" and select the SigOption that was created in Step 3 (C_HIDE). Note: Please ensure you give the "SigOption Data Source ID" value as "MAINRECORD", else the conditional display will not work.




8. Click on the Save button to save the presentation XML.
9. Navigate to Administration -> Conditional Expression Manager, create a new condition. In our example, we have created a condition (C_HIDE). Save the record.
10. Navigate back to the Application Designer and open up the ASSET presentation XML.
11. Open up the properties window for "Loop Location" field and click on the Advanced Tab in the properties dialog box.
12. Click on the "Configure Conditional Properties" button.
13. Click on New Row under the "Security Groups" table and select EVERYONE
14. Click on New Row under the "Conditions for Security Group.." and select the condition that we created in Step 9 (C_HIDE).
15. Enter the property details as below:



16. Grant access to the newly created Signature Option under EVERYONE security group. If the group selected is different in Step 13, grant access to that specific group.
17. Log off and Login again.
18. Open the Asset application and check.




Wednesday, 5 March 2025

Display Length in Internal help Field

Maximo has the ability to display internal help about the field by pressing ATL + F1 or ALT + i. But sometime, I would like to know the length of the field with the Object, Attribute and remarks field. This can be achieved by making some changes in the jsp.


Navigate to the below location.

<SMP>\maximo\applications\maximo\maximouiweb\webmodule\webclient\components\fieldhelp.jsp


Below is the change you need to make in the fieldhelp.jsp. Make sure to take back up of the fieldhelp.jsp


String helpRemarks = fhComponent.getProperty("remarks")+".{"+fhComponent.getProperty("length")+"}";


After making the change, you need to build and deploy.





Wednesday, 27 September 2023

Uninstall MAS SNO from AWS cloud

 

To install SNO instance please refer the IBM provided link below.

https://ibm-mas-manage.github.io/sno/

 

The below topic helps us understand, how to uninstall SNO that was installed in AWS cloud instance.

The first step is to log into the docker container. The next step is to find the path where the SNO instance was installed. Then navigate to the location installation where the  command is present.

 

Step 1: Log into the Docker container



 



Step 2: Navigate to the Location where the MAS SNO is installed.

The path is given below 

  
  
  /opt/app-root/src/masconfig/sno/config/<Cluster Name>

Copy the path name.





Step 3: Navigate to the location where the uninstall command is present.

  /opt/app-root/src/masconfig/sno/installer/latest-4.10
  


 


Syntax

  ./openshift-install
destroy cluster --dir/opt/app-root/src/masconfig/sno/config/<Cluster Name>
--log-level=debug

The cluster name is the above example is SYDNO.

  ./openshift-install
destroy cluster --dir/opt/app-root/src/masconfig/sno/config/sydno
--log-level=debug

 





By running the above command, the cluster is deleted in AWS cloud. This takes care of all the component deletion in AWS including (VPC, subnets, IAM user and etc).







Friday, 2 September 2022

Maximo Script to Remove HTML Tags Using Regular Expression

 There are times when you need to send long description to external system. But the problem occurs when the Long Description is rich text enabled and contains html tags. Below script uses regular expression to remove the HTML tags.

print ("***********Start of the Script************")
from java.util.regex import Pattern
item_long = mbo.getString("DESCRIPTION_LONGDESCRIPTION")
print (item_long)
match_v1 = Pattern.compile('\\<.*?\\>').matcher(item_long).replaceAll('')
print (match_v1)
print ("************End of the Script**************")

Result

**********Start of the Script************
<div>dasdasd</div><div>sdasd </div><div>asdasd </div><div>asdasdasd </div><div>sdasdas <br /></div><!-- RICH TEXT -->
dasdasdsdasd asdasd asdasdasd sdasdas 
************End of the Script**************

Thursday, 30 June 2022

Maximo Attachment File Size

 Below is the script to calculate the Attachment size in Maximo. The File class is used to get the File details and Length() method is used to capture the size details.

from java.io import File 

path = mbo.getString("DOCLINKS.DOCINFO.URLNAME")
print("The Path Value:",path)
if (path):
	file =  File(path)
	print("The Size of the File in Bytes",file.length())
	print("The Size of the File in MB",file.length()/1024)
	print("The Size of the File in GB",file.length()/(1024 * 1024))
Below is the output captured in the system logs.
[6/30/22 8:01:53:951 EDT] 000000e2 SystemOut     O 30 Jun 2022 08:01:53:951 [INFO] [MXServer] [] ('The Path Value:', u'c:\\DOCLINKS\\ATTACHMENTS\\Maximo-access-via-Published-Service-in-your-local-laptop-browser.docx')
('The Size of the File in Bytes', 543667L)
('The Size of the File in MB', 530L)
('The Size of the File in GB', 0L)

Tuesday, 20 April 2021

Maximo Date Format Conversion Using Automation Scripts

We can convert the normal date format to Maximo date format (yyyy-mm-ddThh:mm:ss.ffffff) using Automation Script.

Script Language: javascript

load("nashorn:mozilla_compat.js");
importPackage(Packages.java.text);

erData.breakData();
var actualDate = erData.getCurrentData("ACTUALDATE");
print("INPUT : " +actualDate);

var inputFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a");
var outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
var dateParse = inputFormat.parse(actualDate);
var maximoDate = (outputFormat.format(dateParse)).replace(" ", "T") +"+05:30";
print("OUTPUT : " +maximoDate);

erData.setCurrentData("ACTUALDATE", maximoDate);

Output:

INPUT : 4/20/2021 03:30:52 PM
OUTPUT : 2021-04-20T15:30:52+08:00

Monday, 8 March 2021

Maximo Date Manipulation Using Automation Scripts

In this topic, we are going to see how to manipulate Maximo dates using Automation scripts. The different kinds of manipulation are

  1. Adding Number to the date
  2. Subtracting Number to the date
  3. Changing the format of the date
  4. Difference between two dates in days 

In the below examples we are going to use Python scripts in Maximo

  1. Object Launch Point is used
  2. Asset object
  3. The “INSTALLDATE” attribute is modified

  Java Calendar class is used for Date Manipulation.


1.     Adding Number to the date

Current date from MXServer is got and adding number (10) to that date.

print("**************Start of C_TEST ********************")
from java.util import Date
from java.util import Calendar
from psdi.server import MXServer

currentDate = MXServer.getMXServer().getDate()
cal = Calendar.getInstance()
cal.setTime(currentDate)

cal.add(Calendar.DATE, 10) 

print ("After Additional to Current Date ---> ",cal.getTime()) 

mbo.setValue("INSTALLDATE",cal.getTime()) 
print("**************End of C_TEST ********************")