Question
How to clear comments form on pressing the Submit button?
Hi!
I have an assignment with comments form (text area, "add comment" button, and history of comments). It is designed with standard Pega mechanism. At clipboard there is page Note (Data-WorkAttach-Note) and page AllNotes (Code-Pega-List).
Button "Add comment" contains a control pxButton with behavior:
Event Click - Refresh Section (Target: This section).
Button Submit is designed as custom submit button with a single action in its behavior:
Event Click - FinishAssignment.
So I have such problem. I have to add new comment only by pressing "Add comment" button. But new comment is also added when I press Submit. I tried to solve this problem by adding events on Submit button in these ways:
1) Add an event Display -> Set Value -> Note.pyNote == "", and event Refresh before FinishAssignment.
2) Add Data Transform that sets Note.pyNote to "". (before FinishAssignment).
3) Add Activity that sets Note.pyNote to "". (before FinishAssignment).
But it doesn't work. Comment always move to AllNotes list on Submit button
Can anybody help to solve it?
Hi Aleksey,
I have a query that when you say that somments always gets posted, is that empty comments gets posted into the AllNotes list ?
Also do you have any activity which adds the comments to AllNotes list? if not is AllNotes is a pagelist inside your workpage and are you having a grid in the section to add notes/comments?
If possible please share your UI, to understnad the uscase better.
How about tracing the submit button action, and check at what step it is adding the comments to the AllNotes list.