Question
Nationale Nederlanden
NL
Last activity: 29 Nov 2019 9:52 EST
How to remove Edit validation messages
Hello,
when an workobject is open and it contains edit validation messages, you can't cleared them via Clear-Page-Messages. Is there a way to remove all messages?
Because of the edit validation message it is impossible to save the data to another workobect.
Regards,
Maurice Boer
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi
If I have understood your requirement correctly then below is the local change (Java code) to clear the error messages from clipboard.
You can include the below code in the Java step of an activity and refer/call the activity to remove the error messages from clipboard.
java.util.Map messages = myStepPage.getMessagesMap();
java.util.Set propertySet = messages.keySet();
java.util.Iterator propertyIterator = propertySet.iterator();
while(propertyIterator.hasNext()){
String property = (String)propertyIterator.next();
myStepPage.clearValue(property);
}
Please find the below screenshot for reference,
Note: This activity checks for all the property values in "pyWorkPage" and removes all the property values which has errors.
Hope this helps!
Thanks,
Hi
If I have understood your requirement correctly then below is the local change (Java code) to clear the error messages from clipboard.
You can include the below code in the Java step of an activity and refer/call the activity to remove the error messages from clipboard.
java.util.Map messages = myStepPage.getMessagesMap();
java.util.Set propertySet = messages.keySet();
java.util.Iterator propertyIterator = propertySet.iterator();
while(propertyIterator.hasNext()){
String property = (String)propertyIterator.next();
myStepPage.clearValue(property);
}
Please find the below screenshot for reference,
Note: This activity checks for all the property values in "pyWorkPage" and removes all the property values which has errors.
Hope this helps!
Thanks,
Geeda.
-
Raghavender Reddy Lankapothu
Nationale Nederlanden
NL
Hello Geeda,
thanks for the code. But by this the value of the property will be removed as well. I am not that create java expert but is it also possible the error message itself and keep the not correct value of the property. When the property is resaved then the error should be removed and that works fine. So when to do Property-Set to replace the property with itself then the edit validation will disappear. Not sure if the will happen also when done by Java instead of the Property-Set methode.
Regards,
Maurice
Nationale Nederlanden
NL
Hello Greeta,
I managed myself to get to the solution without deleting the value but able to remove the messages:
Instead of
myStepPage.clearValue(property);
I use
myStepPage.putString(property,myStepPage.getString(property));
This simulate the situation to remove the edit validate message by touching the property.
Pegasystems Inc.
FR
Hello,
Maybe you could block the edit validate rule but will it a good idea? Do you really want to copy those data to another WorkObject if they are incorrect?
Nationale Nederlanden
NL
Yes that is correct. For background information:
The other workobject will contain the data of the corrupt workobject (as a seperate page). By this at a later stage we can investigate what was the root case of the error. The error might not related to the validation error but to another cause.
E.g. in this particular example I am working on at the moment, we have cases of which for some reason the assignments disappear while the cases are not being resolved yet. We have placed tooling to recreate the assignments, so correct the problem, but when doing this all the situation of the corrupt case will disappear.
Pegasystems Inc.
FR
Disappear from the Worklist/Workbasket and from the database as well? Did you double check on the database side? Any relevant information from case history to understand who/what has process/delete this assignment ?
Nationale Nederlanden
NL
We have checked already a lot of possibilities including your suggestions.
Pegasystems Inc.
IN
The Page-Clear-Message method is used to delete all messages placed by the Page-Set-Messages method on the step page. Messages placed by constraints rules, edit validate rules, and property type validation are not cleared - they are cleared and the restrictions are detested only when the property value changes.