Support Article
Incorrect behaviour of "Open Work Item" Action
Summary
Unable to open a work object using OpenWorkItem. A property reference is provided to maintain the work object ID as the input parameter for OpenWorkItem.
Error Messages
Work Object Not Found
The work object was not found in the current application.
Check the ID and try again.
(or)
Pop-Up with message “Undefined”
Steps to Reproduce
- Create a Navigation Rule.
- Navigate to the Actions tab > Configure an activity to create a work object and open it.
Root Cause
Menus do not support change track enabled actions. They resolve property references in the actions while rendering them and stamps them directly in the action JSON. When the property value changes in any of the menu actions, the value is not propagated to the subsequent actions.
Resolution
Perform the following local-change:- Include a hidden button with open workitem in the section
- Use the RunScript action after the refreshSec with custom activity on the menu (to start the custom activity)
- Click the hidden button. The RunScript action must trigger a custom function which fires a top priority click event on the hidden button.
Include a HiddenButton button with the openWorkHidden cell read-write class, openWorkHidden cell read-only class, and openworkitem action in TestSec section. Refer the Fixnav navigation rule for menu configuration. Additionally, add the following script in UserWorkForm:
<script>function customWorkItemOpener(){
var hiddenButton = $(".openWorkHidden button");
if(hiddenButton[0])
{
pega.control.actionSequencer.fireTopPriorityEvent(hiddenButton[0], 'click');
}
}
</script>
Published October 31, 2017 - 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.