Event in Notes Form after open and visible

In my Lotus Notes program I would like the user to see the document that was just opened, but stop them at that point and ask if they'd like to accept ownership of the document that they are opening.  I thought the form's PostOpen would be the event to place the messagebox, but the box appears before the form is loaded.
Is there a way to make this happen?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I scanned the IBM help for the order of events, but could not find anything helpful for the form events.

So I suggest adding a test messagebox to each form event that merely displays the name of the current event. Then test your scenario to see which messagebox appears after the form has been displayed.
lwillfordAuthor Commented:
I did that, but none of the events (messageboxes) showed after the form was opened.  I did see QueryModeChange fire when I got into edit mode, which wasn't exactly what I was looking for.  It could be a workaround though I guess.
Then another option is to force the issue. Add code to the form's PostOpen event to force the focus to a specific field. Then add your messagebox to the Initialize event of that field. I would also set some flag so the user doesn't see the messagebox every time they enter that field. You could clear the flag at the beginning of the form's PostOpen event.
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Sjef BosmanGroupware ConsultantCommented:
There is always the possibility to use a NotesTimer, but I have to warn you beforehand: it is (or used to be) very buggy. It helped me though in many a difficult situation.

Start a NotesTimer during the PostOpen and make it go off half a second later, i.e. when the form is open. That's the dirty solution.

A more proper one might be to have one computed field with @Prompt. If it computes a non-existing field, I supposed it is evaluated when the document is being opened. When exactly do you want to show the dialog box? I do have to test this tomorrow, getting rather late over here...
lwillfordAuthor Commented:
ThomasMcA2 - I did try that suggestion to force the focus on a field, and put the msgbox in the Initialize event for the field, but it still triggered prior to being able to see the document.

Sjef - I'll give the timer a thought, but I agree, not the best way.  I want the user to be able to decide to answer the question yes or no based on what they see on the document.  They may not want to take ownership of it, so they need to be able to see what is on the document while the question is up.
What is the purpose of the pop-up? Is it to prevent edits before they have accepted ownership of the document? If so, why not display the document in read-only mode, and give them an "Accept Ownership" button that changes the document to edit mode?
Sjef BosmanGroupware ConsultantCommented:
IMHO the NotesTimer is the most likely candidate for a solution. Just make sure that you completely reopen the document when you change it in read mode.
lwillfordAuthor Commented:
It's basically a workorder that is emailed to a group of people.  Only one person can work on it, so we want to force them to accept ownership of it right away, instead of accidentally forgetting to push a button on the form to take ownership (which would allow someone else to take ownership of it).  I was originally going with a record locking type of system, but due to their inability to delete documents in this database it didn't work.  The system needs to have some sort of trigger to make the change happen.  Not just viewing and printing the document.
Sjef BosmanGroupware ConsultantCommented:
That doesn't seem too hard to accomplish. Would it be possible to adapt the form a little? Like this:
- add a section somewhere to the form that's only visible when Owner=""
- it contains 2 buttons: one to refuse ownership (which closes the document) and one to accept (which sets the Owner field)
- make sure the document cannot be put in Edit mode while Owner=""
- you might also hide other parts of the form when Owner=""
- the section won't display when Owner has a value

Is that doable for you?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lwillfordAuthor Commented:
Sjef - I will have to play around with that concept.  The sticky part is that it is just a work order that could be completed without making any edits to the document.  It's a request to put an order together, so they just need to look at the request to start working on it.  But if I hid some of the important details on it, that would force them to make a choice on the ownership.  I will give that a try.  Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.