MAS 9.2 series cookbook
This recipe adds the GL account of a work order to a detail page. We ran every step on our test system, on the MAS 9.2 series, and the complete pages are at the end as a download. It builds on Datasource Basics and Data Binding.
What you need#
- An app of your own that builds on your machine. Hello World gets you one.
- The page you want to change, and the datasource that feeds it.
- The name of the attribute in the object structure. Step 1 finds it.
The page we start from#
Our page shows work order 1221 with five fields. The datasource reads one record from the object structure mxapiwodetail, and its schema names six attributes:
<maximo-datasource id="fs_k_start_wo" object-structure="mxapiwodetail"
where="wonum="1221" and siteid="BEDFORD"" page-size="1">
<schema id="fs_k_start_wo_s">
<attribute name="wonum" unique-id="true" id="fs_k_start_a_wonum"/>
<attribute name="description" id="fs_k_start_a_desc"/>
<attribute name="status" id="fs_k_start_a_status"/>
<attribute name="status_description" id="fs_k_start_a_statusd"/>
<attribute name="worktype" id="fs_k_start_a_worktype"/>
<attribute name="wopriority" id="fs_k_start_a_prio"/>
</schema>
</maximo-datasource>Each field binds to one of them through the current record of the datasource:
<field id="fs_k_start_f_worktype" label="Work type" value="{fs_k_start_wo.item.worktype}"/>
<field id="fs_k_start_f_prio" label="Priority" value="{fs_k_start_wo.item.wopriority}"/>Step 1 · Find the exact name of the attribute#
The schema takes the name the object structure uses, letter for letter. For the GL account of a work order that name is glaccount. The object structure MXAPIWODETAIL has 660 attributes on our system, so we search for it. Our MAF editor lists them in its Data tab:

Without the editor, the Object Structures application in Manage shows the same list, and so does a request to the API that selects the attribute.
Step 2 · Add the attribute to the schema#
One line, inside the <schema> of the datasource that feeds the page:
<attribute name="wopriority" id="fs_k_field_a_prio"/>
<attribute name="glaccount" id="fs_k_field_a_gl"/>
</schema>The id has to be unique in the whole app. The name is the one from Step 1.
The schema is the request. The datasource asks Maximo for the attributes of its schema and for nothing else. We read the request of both versions of the page in the browser:
| Page | oslc.select in the request |
|---|---|
| before | wonum,description,status,status_description,worktype,wopriority |
| with the attribute | wonum,description,status,status_description,worktype,wopriority,glaccount |
On a device the same list decides what the app downloads for offline work. An attribute outside the schema is on no device.
Step 3 · Add the field to the page#
One more line, between its two neighbours:
<field id="fs_k_field_f_worktype" label="Work type" value="{fs_k_field_wo.item.worktype}"/>
<field id="fs_k_field_f_gl" label="GL account" value="{fs_k_field_wo.item.glaccount}"/>
<field id="fs_k_field_f_prio" label="Priority" value="{fs_k_field_wo.item.wopriority}"/>The binding names the datasource whose schema you changed in Step 2, then item, then the attribute. <field> shows a value. For a value the user may change, the element is <smart-input>, and Forms and Input Fields covers it.
Step 4 · Build and look#
yarn clean && yarn build:mobileThe clean matters: a second build without it finds nothing changed and checks nothing. Then open the page in the preview.

The middle frame is the result: 6200-200-200, the GL account of the work order.
The mistakes that pass the build#
We made three mistakes on purpose, each on its own copy of the page.
| Mistake | Build | What the page shows |
|---|---|---|
| The field without the attribute in the schema | passes, no warning for it | a striped bar in place of the value, still there after 25 seconds |
A misspelled name in the schema, glacount | passes, no warning for it | the same striped bar. Maximo answered 200 and left the unknown name out |
An id used twice | stops with exit code 1 | nothing, and the message names the id |
Only the third one stops you:
[ERROR]: Duplicate id: 'fs_k_dup_f_prio', detected in element: field ...The first two are the dangerous ones. The striped bar looks like a value that is still loading, so the page seems slow where it is wrong. Our MAF editor marks the first mistake before any build, at the binding:

Its finding reads: “The binding reads fs_k_miss_wo.item.glaccount, and the datasource fs_k_miss_wo does not select glaccount in its schema, so the field stays empty.” When a new field stays empty, look at the schema first, and compare the name with the object structure letter for letter.
The same places in an IBM app#
In an app you duplicated from IBM, the two edits go to the same kind of place. In the Technician app of the 9.2 series the datasources sit in src/app.xml, and most of the page markup sits in fragments under src/maml/pages. Find the page, read which datasource its fields bind to, and add the attribute to that datasource’s schema. The Technician app has 14 datasources on the work order structure alone, and only the one in the binding counts.
Download#
The three pages of this recipe: the page we start from, the page with the field, and the page with the mistake.
This recipe as a PDF, to print or to read offline.
What to read next#
The next recipe adds a dialog to the same page. Datasource Basics explains what else a schema decides, and MAML Basics explains why a warning ships.
IBM documents the elements of this recipe in the product itself. In the Application Configuration application, open the ? menu and choose Component Documentation for field, maximo-datasource and attribute.
