How to copy error messages from Temporary Page to Primary Page
I am triggering a local action on click of a button. I am referring some of the fields in the section using a Temporary Page. I've configured a flow-action's post-activity where I am handling the validation of the screen.
The issue is my validation is running fine and setting error messages on embedded properties of the aforementioned temporary page but not on the primary page. Hence, user is allowed to submit the screen even if there are error messages on the Temporary page. I am using OOTB rules for validation.
The question is how to copy the error messages on embedded properties of the temporary page to the primary page so as to restrict the user submission.
I've written the below java code in my post-activity to do the same and is fixing the issue. I am wondering if there's any better way of doing this than writing Java code.
I used this function in the activity by using "Call-Function" method with the value "@Page.pxCopyMessages("Product",myStepPage)". Here, myStepPage is the Primary page on which I want to see the errors.
I am facing null pointer exception at runtime when I use this function. I tried recompiling "Page" library but no luck. Should I restart the server?