Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Maximo Mobile Technician Doclinks Performance

By Piyush Sukhadiya posted Mon May 05, 2025 04:52 AM

  
Update doclinks to improve the performance of mobile data download for workorders
 
This guide instructs how to create and use a new doclinks relationship in mobile to better perform the workorder list download.
 
Note:
  • This guide includes changes in MXAPIWODETAIL object structure. That can affect other APIs as well, consuming the object structure.
  • Direct database changes are also included in the guide. Therefore, before carrying out these actions, the proper best practices should be followed, such as backing up the database beforehand and implementing the modification in the development environment first
 
 
Step 1: In this step, we will create a new relationship that downloads only the workorder's doclinks and attachments on mobile
 
1. Go to the database configuration application
2. Search for WORKORDER and select it
3. Go to relationships
4. Create a new relationship
5. Name it MOBILEDOCLINK
6. Select DOCLINKS for Child Object field
7. Set the where clause to 
 
ownertable='WORKORDER' and ownerid=:workorderid
 
 
 
This includes only the workorder’s attachment. You can alter this query (Where clause) to add more objects based on usage. Here is an example of how we can add attachment data for Assets in the same query.
 
doclinksid in (select doclinksid from doclinks where (ownertable='WORKORDER' and ownerid=:workorderid) UNION ALL select doclinksid from doclinks where (ownertable='ASSET' and ownerid in (select assetuid from asset where assetnum=:assetnum and siteid=:siteid)))
 
Adding here the Out of the Box doclink relationship to refer to build your custom query. Remove the UNION ALL section for the object you don't want its attachment to download on mobile.
 
doclinksid in (select doclinksid from doclinks where (ownertable='WORKORDER' and ownerid=:workorderid) UNION ALL select doclinksid from doclinks where (ownertable='WORKORDER' and ownerid in (select workorderid from workorder where parent=:wonum and istask=1 and siteid=:siteid)) UNION ALL select doclinksid from doclinks where (ownertable='ASSET' and ownerid in (select assetuid from asset where assetnum=:assetnum and siteid=:siteid)) UNION ALL select doclinksid from doclinks where (ownertable='LOCATIONS' and ownerid in (select locationsid from locations where location=:location and siteid=:siteid)) UNION ALL select doclinksid from doclinks where (ownertable='JOBPLAN' and ownerid in (select jobplanid from jobplan where jpnum=:jpnum and (siteid is null or siteid=:siteid) and pluscrevnum =:pluscjprevnum) ) UNION ALL select doclinksid from doclinks where (ownertable='PM' and ownerid in (select pmuid from pm where pmnum=:pmnum and siteid=:siteid)) UNION ALL select doclinksid from doclinks where (ownertable='SAFETYPLAN' and ownerid in (select safetyplanuid from safetyplan,wosafetyplan where safetyplan.safetyplanid=wosafetyplan.safetyplanid and wosafetyplan.wonum=:wonum and wosafetyplan.siteid=:siteid)) UNION ALL select doclinksid from doclinks where (ownertable in ('SR','INCIDENT','PROBLEM') and ownerid in (select ticketuid from ticket,relatedrecord where ticketid=recordkey and ticket.class = relatedrecord.class and relatedrecclass=:woclass and relatedreckey=:wonum and relatedrecsiteid=:siteid)) UNION ALL select doclinksid from doclinks where (ownertable in ('WOCHANGE','WORELEASE','WOACTIVITY') and ownerid in (select workorderid from workorder,relatedrecord where wonum=recordkey and workorder.woclass = relatedrecord.class and relatedrecclass=:woclass and relatedreckey=:wonum and relatedrecsiteid=:siteid)) UNION ALL select doclinksid from doclinks where (ownertable='COMMLOG' and ownerid in (select commloguid from commlog where ownerid=:workorderid and ownertable in (:&synonymlist&_WOCLASS[ACTIVITY,CHANGE,RELEASE,WORKORDER]))) UNION ALL select doclinksid from doclinks where (ownertable='SLA' and ownerid in (select slaid from sla,slarecords,workorder where sla.slanum=slarecords.slanum and slarecords.ownerid=workorder.workorderid and sla.objectname='WORKORDER' and slarecords.ownertable='WORKORDER' and workorder.wonum=:wonum)) UNION ALL select doclinksid from doclinks where (ownertable='PLUSDSPLAN' and ownerid in (select plusdsplanid from plusdsplan where (siteid is null or siteid=:siteid) and status in (select value from synonymdomain where (siteid is null or siteid=:siteid) and domainid = 'PLUSCDSSTATUS' and maxvalue = 'APPR') and dsplannum in (select dsplannum from pluscwods where wonum=:wonum and siteid=:siteid))))
 
Step 2:  Now we can update the object structure to utilise the newly created relationship by running this database query on your database 
 
update MAXINTOBJDETAIL SET RELATION='MOBILEDOCLINK' where INTOBJECTNAME='MXAPIWODETAIL' and  RELATION='DOCLINKS' and HIERARCHYPATH='WORKORDER/DOCLINKS'
 
Step 3:  Replace the doclink relationship with the new relationship MOBILEDOCLINK everywhere
 
In app.xml
1. In the example below, observe the relationship attribute. Change this line
 
<maximo-datasource id="attachmentListDS" attachment="true" page-size="250" relationship="doclinks" selection-mode="none">
 
Change to
 
<maximo-datasource id="attachmentListDS" attachment="true" page-size="250" relationship="MOBILEDOCLINK" selection-mode="none"/>
2. 
<maximo-datasource id="signatureAttachment" can-load="{page.state.canLoadWoDetailsChilds}" attachment="true" relationship="doclinks" selection-mode="none" notify-when-parent-loads="true">
Change to

<maximo-datasource id="signatureAttachment" can-load="{page.state.canLoadWoDetailsChilds}" attachment="true" relationship="MOBILEDOCLINK" selection-mode="none" notify-when-parent-loads="true">

 3. in
woDetailResource datasource, change attribute from 

<attribute name="doclinks" id="r_kd9">
to 

<attribute name="mobiledoclink" id="r_kd9">

 
Step 4: Enhancing performance further by adding a database index 
 
Add a new index in your database to improve doclink queries further, if it does not already exist
 
create index DOCLINKS_OWNERID_IDX_TEST on DOCLINKS ("DOCLINKSID","OWNERID", "OWNERTABLE");
 
Doclinks for WOACTIVITY (Tasks)
 
Step 1: Same as the above procedure, doclinks for the WOACTIVITY object can also be simplified as below
 
1. Go to the database configuration application
2. Search for woactivity and select it
3. Go to relationships
4. Create a new relationship
5. Name it MOBILEDOCLINK
6. Select DOCLINKS for the Child Object field
7. Set the where clause to 
 

ownertable='WOACTIVITY' and ownerid=:workorderid

Step 2: Now we need to update the object structure to utilise the newly created relationship by running this database query on your database 
 
update MAXINTOBJDETAIL SET RELATION='MOBILEDOCLINK' where INTOBJECTNAME='MXAPIWODETAIL' and  RELATION='DOCLINKS' and HIERARCHYPATH='WORKORDER/WOACTIVITY/DOCLINKS' and  RELATION='DOCLINKS';


Note: If you are not using attachments in Tasks of workorder on Mobile, it is better to remove them altogether. This will also make a good difference in performance. 
1. Remove the below attribute from woPlanTaskDetailds and woPlanTaskDetaildsSelected datasources
<attribute name="doclinks{*}"/>
2. Remove the below datalist (id- q439v) part for UI removal



#MaximoMobile #Technician #MobileTechnician #MobileDataDownload #MobileDocLinks #DocLinks #MaximoDocLinks #Performance #CheckForUpdates 
0 comments
41 views

Permalink