Hi guys,
Using PB2019 R3
Looking for some general advice , tips & tricks.
Our users are heavily using copy/paste function from windows. I have 2 little questions about this
1) many times our users are copying data which isn't in the correct format. Think about a space in an amount which is copied into a decimal datawindow field.
Do you guys use any "clean" function before the pasting of the information to prevent datawindow popups like "item does not pass validation test" ? What's the best way to handle this please ?
2) Also , when this error pops up : item does not pass validation test , it takes our users 50 to a 100 times to get this window closed. How can i gracefully let them know 1 time please ?
TIA
John
nope it doesn't for the moment, but i do realise i need to come up with a solution for this.
i can go either of possible 2 ways here
option 1 : prevent that the itemerror event is triggered by cleaning the pasted data
option 2 : or handle it in the error event to a more gracefully "exit" than 50 times pressing OK
that was kinda my question , how are you guys dealing with this behaviour ?
Thanks.
Regards
John
Unfortunately, the paste operation places the data in text format into the DataWindow's keyboard input area. This is the same area that an App user would key into using their keyboard. In an ItemFocus changed, enter or an AcceptText() command is issued, the DWO then tries to validate the text input as it tries to move it to the DWO's primary buffer. If the validation sequence at that point fails, then the ItemError event is fired. That's where I normally handle the issue.
You can also handle it in the Error event but the DWO could easily fire the ItemError event multiple times. Hence, the App user having the hard time getting out of the validation sequence - which depending on your DC's code, could happen multiple times.
So just my $0.02, I would try & handle the issue in the ItemError event. The other way that I've used is to remove the validations from the DWO altogether & then validate the DWO changes under script control before issuing the Update() command.
HTH
Regards ... Chris