Support Article
OOTB Search does not work for descendant class work objects
SA-85239
Summary
When a Search string belongs to descendent class work objects stored in a separate table (as per design requirements), the out-of-the-box pxRetrieveSearchData Search activity does not display results.
However, the report passed as a parameter to this activity works correctly when the 'Include all descendant classes' checkbox is enabled. Hence, results display when a Search string is entered for the descendant class work objects.
Error Messages
Not Applicable
Steps to Reproduce
- Create a child work type class which is defined as a class group in the main work type
- Use the out-of-the-box pxRetrieveSearchData Search activity and pass the parameters as below:
ReportName - pyWorkSearch
CaseTypeList - All
TypeOfWork - All work
IncludeAttachments - Work items only
UpdatedOn - Anytime
ReportClass - <The Parentclass>
pyMaxResults - 20
SearchString - <Child work object id>
- Include both the Implementation classes (that is, the child work type and the main work type) in the Application Rule Definition for each client.
- Launch the portal.
- Enter a Search string.
- Click the magnifying glass or press the Enter key.
Root Cause
According to the pxRetrieveSearchData activity design, when the Search query is executed, a condition is created automatically as the below criteria:
- If the class specified by pyReportClassName is Concrete and not a Workpool, use the class as is (which occurs in the current scenario). If the class is Concrete and a Workpool, all classes that start with the class name are searched.
- If the class specified by pyReportClassName is 'Rule-' or 'Data-Rule-Summary', all the Rule types are searched.
- If the class specified by pyReportClassName is 'Data-', all the Data types are searched.
- If the class specified by pyReportClassName is 'Work-', all the Work types are searched.
- If the class is Abstract and is not one of the above cases, an error message is displayed to the Code-Pega-List page. Search reports can only be defined on a Concrete class, or on one of the following abstract classes: Work-, Rule-, Data-, and Data-Rule-Summary.
Resolution
Perform the following local-change:
- Move the report definition to a parent class which is a Work Group (not belonging to a work group).
- Add an entry in the Keys section of the child class definition (pyID as Name and ID as Caption).
Published March 27, 2020 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.