IBM Support

Adding a domain to a field in Maximo Mobile

Technical Blog Post


Adding a domain to a field in Maximo Mobile


A lot of people add new domains to fields in Maximo Base Services and want to know if they can also be added to Maximo Mobile. 
The answer to that is yes, I will outline the steps I have performed to add a new field and domain to the asset screen in the Mobile Asset Manager application.
The prerequisite is to have added a new attribute or use and existing attribute in Database Configuration, Add a new domain in Maximo using the Domains Application You will also want to use Application Designer to add the field to the Asset screen in Maximo. 
For my example I am using the field EQ1 this is an extra field on the Asset table. I have created a new Domain called EQ1 and added it to the Asset screen.
Using a text editor, I use Notepad ++ for making the changes to the mobileam.xml file.
Open the mobileam.xml and in the mobilembos section, Under the mobilembo for asset we need to add our new field EQ1. I like to add a commented out line, above any change I make, so I can document changes that have been made, It also makes it easier to search on any changes you have made. To comment out a line add   <!-- To the front and back of your comment -->


The <mobilembos> sections is the first section in the xml file, You will see it once you open the file using your text editor.
<mobilembo name="ASSET" mboname="ASSET" type="workset" usequeries="true" queryrequired="true"
 Under the mobilembo for asset we add a line for our new field
                <!-- Mike Added mobilemboattribute EQ1  -->
<mobilemboattribute name="EQ1" mboattribute="EQ1"/>
Next we will need to add our new Domain.
At the bottom of the mobilembo section you will see where the existing Domains have been added, Here we need to create our new Domain EQ1  
<!-- Mike added domain -->
<mobilembo name="EQ1" mboname="ALNDOMAIN" domain="true" usequeries="false" multisitetype="SYSTEM"
siteattribute="SITEID" orgattribute="ORGID" description="EQ1">
<mobilemboattribute name="ORGID" mboattribute="ORGID"/>
<mobilemboattribute name="SITEID" mboattribute="SITEID"/>
<mobilemboattribute name="VALUE" mboattribute="VALUE"/>
<mobilemboattribute name="DESCRIPTION" mboattribute="DESCRIPTION"/>
<mobilemboattribute name="DOMAINID" mboattribute="DOMAINID"/>
<filtercondition>DOMAINID = 'EQ1' and siteid is null and orgid is null</filtercondition>
<ascending mobilemboattribute="VALUE"/>
Once the Domain has been added we can move to the Lookups section of the mobileam.xml, Here we will add a lookup for our domain this will also be associated to the mobileattribute EQ1 we just added
You can search for <!-- Lookups --> to find the lookups section of the xml file
I have added my new lookup at the bottom of the lookups section
<!-- Mike added EQ1 domain lookup -->
<lookup id="eq1lookup" datasrcname="EQ1" mobilembo="EQ1" returnattribute="VALUE" nextsetattributes="VALUE"
<table id="eq1lookuptbl" rowsperpage="10" toolbar="lookuptoolbar">
<tablecolumn id="eq1lookup1" displaymode="fixed" label="Value" dataattribute="VALUE">
<link id="eq1lookup1L" event="multiselect" dataattribute="VALUE"/>
<tablecolumn id="eq1lookup2" dataattribute="DESCRIPTION" displaymode="visible"/>
After we add the lookup we then add the new field EQ1 and domain EQ1 to the Asset screen, Lets now go to the screens section of the mobileam.xml
You can search on <page id="assetmain" this will take you to the section for the Asset main screen.


<page id="assetmain" label="Asset" datasrcname="ASSETWORKLIST" mobilembo="ASSET" insertesigoption="CREATEASSET"
handler="asseteventhandler" validateevent="validate" initevent="cleanmboreadonlyattr">
<section id="assetdet">
Here we will add the textbox for our new field and associate the dattaattribute, lookup and domain. The label can be any value you want displayed on the screen,
The fields display on the screen in the order they are listed in the page id section of the xml file. You also need to verify that the textbox id is unique. 


      <!-- Mike Added EQ1 and TEST1 -->
              <textbox id="assetdet82" dataattribute="EQ1" lookup="eq1lookup" domain="EQ1" label="EQ1" domainattribute="VALUE"/> 
Once this is done you will need to run importall, packagemobile, delete the /db folder from mobile, Once you sign in to mobile let the software update run so that you have the new mobileam.jar file that was created. When you go to the Asset screen you will now see your new field EQ1 with the domain lookup



[{"Business Unit":{"code":"BU005","label":"IoT"}, "Product":{"code":"SSLKT6","label":"Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]