Intercepting the error message from uiws.PickListCollection

My users are asked to pick a document form a categorized view in a uiws.PickListCollection(PICKLIST_CUSTOM…

If the user places the cursor on a category before clicking OK, Notes displays the message “Invalid selection”.

I would prefer to give a more specific message to the users, but I’m not able to intercept the error message.

I have tried with an onError Statement which Goto an errorhandler with Messagebox Error$ & ": " & Cstr(Err), to see what error is raised, but the error trapping appearantly doesn’t trigger before the built-in message is displayed

Any idea how the standard error message may be supressed by a custom one?

Subject: Intercepting the error message from uiws.PickListCollection

How about testing the result of the PickListCollection selection when the user clicks OK; then give an appropriate message; e.g.:

If dc.Count = 0 Then

Messagebox “A document was not selected.”, MB_OK + MB_ICONSTOP,“Action Cancelled”

Exit Sub

End If

Subject: RE: Intercepting the error message from uiws.PickListCollection

Thanks for your reply, but I already have a test on dc.Count = 0. That test will catch the user clicking Cancel in the dialog box, but if the user has set the cursor on a category and clicks OK, the “Invalid selecton” message kicks in first.

Subject: RE: Intercepting the error message from uiws.PickListCollection

You can’t intercept the error message (or any event that happens while the dialog is still open). That’s just how the pick list dialog works. Looking at the return value doesn’t help because the dialog doesn’t close when it displays this message – it hasn’t returned to your code yet.

If the category names are short, you could use “categorized is flat” option in your view so that there are no invalid lines in the view to select.

Subject: RE: Intercepting the error message from uiws.PickListCollection

Using “categorized is flat” is a great idea for other picklists I’m going to create. Thanks, however in this particualr situation it cannot be used.

So from the other comments, I guess there’s no immediate sollutio in sight.

Since we have now gotten both CaretCategory and CaretNoteId into play in LS, perhaps some of this eventually will flow into the PickList as well.

Subject: Intercepting the error message from uiws.PickListCollection

This is a long-time bugbear of coders as you can’t intercept the error; it takes place within the low level code of the dialog itself, i.e. well before any of your code can get to it. The only solution is to use something other than categorised views, or get used to it. It would be nice to not have to deal with this though.

Subject: RE: Intercepting the error message from uiws.PickListCollection

Please check if there is any code written in view event “PostOpenEvent” or not. May be that code must be doing something…and uncheck view property- “Default when database is first openend”

Hope this could help you

Regards

Shilpa