Hi Meghana,
I had similar requirement to display Inspection Questions and the responses in Work order tracking application. I followed below steps to display the data but you can modify according to your needs.
1.Created a Custom Database View - "INSPRESULTS" with required fields. I am just extending OOB - INSPRESULTFORM in this.
CREATE VIEW INSPRESULTS AS SELECT INSPRESULTFORM.RESULTNUM,INSPRESULTFORM.status, INSPRESULTFORM.name, INSPRESULTFORM.revision, INSPRESULTFORM.groupseq, INSPRESULTFORM.description_question, INSPRESULTFORM.description_field,inspfieldresult.TXTRESPONSE,inspfieldresult.NUMRESPONSE,ISNULL(inspfieldresult.TXTRESPONSE,inspfieldresult.NUMRESPONSE) AS RESPONSE, INSPRESULTFORM.inspformnum, INSPRESULTFORM.inspquestionnum, INSPRESULTFORM.inspfieldnum, INSPRESULTFORM.orgid, INSPRESULTFORM.siteid
FROM INSPRESULTFORM , inspfieldresult
INSPRESULTFORM.INSPFIELDNUM=inspfieldresult.INSPFIELDNUM AND INSPRESULTFORM.INSPQUESTIONNUM=inspfieldresult.INSPQUESTIONNUM AND INSPRESULTFORM.INSPFORMNUM=inspfieldresult.INSPFORMNUM AND INSPRESULTFORM.REVISION=inspfieldresult.REVISION AND INSPRESULTFORM.RESULTNUM=inspfieldresult.RESULTNUM AND INSPRESULTFORM.ORGID=inspfieldresult.ORGID AND INSPRESULTFORM.SITEID=inspfieldresult.SITEID
AND INSPRESULTFORM.STATUS='COMPLETED';
2. Created a new relationship name - INSPRESULTS, Parent- INSPECTIONRESULT and Child - INSPRESULTS
resultnum=:resultnum and orgid=:orgid and siteid=:siteid
3. Created a new section in App designer to display the inspection results.
<section id="1698213071487" relationship="INSPECTIONRESULT" sigoption="HIDEINSP" sigoptiondatasrc="MAINRECORD">
<sectionrow id="1698213071492">
<sectioncol id="1698213071496">
<table datasrc="1698213071504" id="1698213071504" label="Inspection Results" relationship="INSPRESULTS" rowdetailsexpanded="true">
<tablebody id="1698213071509">
<tablecol dataattribute="DESCRIPTION_QUESTION" id="1698334604938" inputmode="readonly"/>
<tablecol dataattribute="DESCRIPTION_FIELD" id="1698334600735" inputmode="readonly"/>
<tablecol dataattribute="RESPONSE" id="1698213071517" inputmode="readonly"/>
</tablebody>
</table>
</sectioncol>
</sectionrow>
</section>
------------------------------
Sarath T
Maximo Consultant
ECCS Ltd
Bristol
------------------------------
Original Message:
Sent: Mon July 22, 2024 11:38 AM
From: Meghana Siriveli
Subject: How to Relate WORKORDER and INSPFIELD objects via INSPQUESTION object to display results in WORK ORDER TRACKING Application
Hello ,
I am trying to add a new tab in work order tracking application to display the Inspection results , The Questions and the responses received against each question for the specific Workorder opened.
An inspection form may contain 1 or more Group Header questions and each question may have 1 or more data entry questions to collect response.
I have referred the Failure code application approach of passing param value from one table to another table to dynamically the display the data for the highlighted record.
so, I have a created a table to display Inspquestion related data. I've created maxrelationship from workorder to inspquestion involving the inspectionresult table to fetch the dataset and used this relation as the source for this table.
Relationship > INSPQUESTION : FROM WORKORDER TO INSPQUESTION
inspformnum=:inspformnum and revision =(select revision from inspectionresult where inspformnum=inspformnum and orgid=:orgid and referenceobjectid=:wonum) and orgid=:orgid
snippet from application xml:
<table relationship="INSPQUESTION" id="question_data" label="Questions" >
<tablebody displayrowsperpage="10" filterable="true" id="question_data_tablebody">
<tablecol filterable="false" id="question_data_tablebody_1" mxevent="toggledetailstate" mxevent_desc="Show Detail" sortable="false" type="event"/>
<tablecol dataattribute="INSPQUESTIONNUM" id="question_data_tablebody_2" inputmode="readonly" label="Question">
<textbox id="question_data_tablebody_2_1" lookup="failurecode"/>
</tablecol>
<tablecol dataattribute="DESCRIPTION" id="question_data_tablebody_3" label="Description" showfilterfield="true" sortable="false">
<textbox id="question_data_tablebody_3_1" lookup="longdesc"/>
</tablecol>
</tablebody>
</table>
As a next step, I have created another table to display Inspfield related data based on the inspquestion highlighted or selected in Question table above.
Here I am not able to figure out a way to bind inspquestionnum to inspfield using maxrelationship
I have initially developed this relationship which fetches all the data entry questions from inspfield. But I want to segregate the results based on inspquestionnum which is not available on workorder object.
relationship from WORKORDER TO INSPFIELD:
inspformnum=:inspformnum and
revision=(select revision from inspectionresult where inspformnum=:inspformnum and referenceobjectid=:wonum orgid=:orgid) and orgid=:orgid
Any pointers would be really helpful.
Thanks
------------------------------
Meghana Siriveli
------------------------------