Sunday, March 10, 2024

Set Label Names Dynamically in Maximo

Set Label Names dynamically in Maximo fields, section/section header or table column/header.

A few scenarios like displaying costs for decommissioned/not ready assets, Hazards and Precautions information for Work Order and Date table column in Assignment Manager application requires labels to have dynamic values to make relevance for current record.

Dynamic Label Names can be set in following places:
  • Field Name based on a sigoption condition by a property label
  • Section or Section Header Name using parameter values
  • Table column label using "Label Source ID" and "Label Attributes"
Field Name change by label property using sigoption condition

In WO application, we have configured "WOPRIORITY" field name based on the work type value condition. If it is PM based WO, then set the label as "PM Priority" else "WO Priority". 



Section Header or Table Control Name using parameter values
We can set a section header with a dynamic label using parameter value properties.

Parameter Values Control  <paramvalues> - contains a list of parameter values with positions that can be replaced with values in label of Section Header

Parameter Value <paramvalue> control defines the datasrc and dataattribute with position for label property. 

datasrc - you can set any datasource that is different than parent control i.e., table or section. If you don't set any datasource, then it inherits the parent's data source. If parent dont have a data source or parent is application, then primary data source of the application MAINRECORD will be taken

dataattribute - based on the datasource we can use an attribute name or any related record. 

position - the number in position will replace the label text in the sectionheader




Table Column - Label Source ID and Label Attributes:

We can dynamically set value for a table column using label source ID and Label attribute tags in table column properties. 

In Assignment Manager application (WORKMAN.xml), Maximo has defined a datasource on CALENDARVIEW mbo which is used for referencing the label source ID and label attributes. 

<datasrc id="AMcalendarview" mboname="calendarview"/>

<tablecol 
classname="rowbg_gray" dataattribute="labor.day1" filterable="false"  id="select_labor_col_7" label="{0}" labelattributes="day1" labelsrcid="AMcalendarview"    mxevent="assignlabgrid" sortable="false" targetid="select_labor_col_7" type="event"/>





References: