Question
National Express
US
Last activity: 18 Jul 2017 10:40 EDT
Inline Edit (entering wrong format) in a field of a Grid, and click on Action button, is not showing any error message.
- When a user enters a wrong format time, and click on Action Button – the error message should be show, alerting the user that the time format is wrong.
- The error message doesn’t show up on the click of “Check In” Action.
Here, I have “On Change – post value” on “Actual Time” property and to set the error messages I have an activity on the action button.
Below is the screenshot of actions on the Action Button.
- When a user enters a wrong format time, and click on Action Button – the error message should be show, alerting the user that the time format is wrong.
- The error message doesn’t show up on the click of “Check In” Action.
Here, I have “On Change – post value” on “Actual Time” property and to set the error messages I have an activity on the action button.
Below is the screenshot of actions on the Action Button.
- activity – Changes the status of the task that would lead the task to show up in another tab based on the status.
- Run Script – We are doing a conditional “delete item”, based on any errors on the screen. If there are no errors, the delete item would happen.
- Refresh current row – To set the error messages on UI.
Any suggestions would be greatly appreciated.
Thank you
Sri
***Updated by moderator: Lochan to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
National Express
US
Hi everyone,
Thank you for all the thoughts and ideas being shared here.
The solution we went through here is, using JS for showing the alert error messages. This doesnt need any refresh of a section or row and it is also saving somerun time for the system.
Thank you All
Sri
Pegasystems Inc.
US
Actions are executed sequentially, so the fact that you are running the script prior to setting the error could be your problem. Even then you may run into timing issues when running a script in the middle of 2 other actions. While I'm sure this isn't the best technical explanation, I've run into several issues in the past where the Run Script action appears to execute asynchronously from the rest of the actions configured on the control. This is probably not actually the case, but more having to do with the perceived time it takes to execute the "control actions" vs. the time it takes to run the script.
What if you configure it to set the error on change of the field instead of waiting for the button to be clicked?
National Express
US
Hi Brendon,
Thank you for your reply.
Thats a good idea but I need to investigate more, if this is a good approach from the project stand point of view.
Pegasystems Inc.
GB
Is it the standard out of the box error for an invalid date that you are expecting to see or something custom set in your script?
E.g when I enter an invalid time I see this:
Questions that occur ito me are:
- Is the Actual Time a Date Time property configured to show just the time?
- If you (as a test only) remove all the actions from your Check In button apart from Refresh Row, do you still get the same problem.
National Express
US
Hi Marc,
Thank you for your reply.
Yes the standard OOTB error message.
- Yes it is a Date Time property configured to show only time.
- Yes, When I have only Refresh row in the actions, the error message is shown. Having Refresh row as a first action and Run Script later, the Run script step doesnt work. So i am looking if I can removed the first Refresh Row and find an alternative way to acheive this. Let me know your thoughts.
Pegasystems Inc.
GB
Ok thanks Sri... When I test this the error appears as soon as focus leaves the time field. If you enter an invalid time, and then click out of the field, but NOT on the button does the message appear?
I think I would like to see exactly what the script you are running is doing (and the activity). Are you sure that it is the script and not the activity that causes the error not to display? Have you tested with just one or the other?
National Express
US
No the message doesnt show up unless I click on the button.
It is the Activity that causes the error to display.
- When I have only these actions i.e., Refresh row, Activity, Refresh row - the error shows up.
- But when i add the script, after the activity - the script is not performing as expected. When i remove the first Refresh row the script is working fine, but the error message doesnt show up. Then i tried using "on change post value" on the Actual Time field, but it dint fix it.
- The script here does a conditional 'delete item' checking for any errors on the screen. The function in the script to do a delete item is below.
function CompassDeleteGridItem(msg,e)
{
if(msg == "")
{
doGridAction(e,"DELETE");
}
}
I hope it answers your question. Please let me know if it doesnt. Thanks
Pegasystems Inc.
GB
Ok thanks Sri... I would have thought that the standard error handling on date time fields should pick this up without the need for an activity.
Unless anyone else has anything to add here I would suggest that you might want to open and SR rather than continuing to dig into the configurtion here.
Pegasystems Inc.
US
What if you run a subsequent activity that conditionally executes your logic instead of running the script directly?
Maybe the parameter isn't getting passed to the script the way you think it is. Maybe could at least test what is getting passed in using a test activity.
Pegasystems Inc.
IN
Hi Sri, Good Morning!
Could you please try the below configurations & share your observations...
- onClick --> Refresh Section (or Other Section to displayErrors) --> Run activity to do Page-Set-Messages if validation fails
- add OOTB section @baseclass.DisplayErrors on your harness rule.
OR
- onClick --> Refresh current row (current item) --> Run activity to perform Obj-Validate if validation fails on the respective line item.
Thank you!
psahukaru
Accepted Solution
National Express
US
Hi everyone,
Thank you for all the thoughts and ideas being shared here.
The solution we went through here is, using JS for showing the alert error messages. This doesnt need any refresh of a section or row and it is also saving somerun time for the system.
Thank you All
Sri
Pegasystems Inc.
US
Thanks for sharing the solution!