Hi... Know that a topic of much debate is when a user press add on a document and you need the new add number. I would be easy to read i SBO was a simple sigle-user application, but it's not.. Many have tried different technics (Check which was last added, catche the text of the statusbar message ect.) but none of them was really great. When faced with the problem myself I found the following approach, and since all these version, I thoght someone might get an insight to this approach which I would say is bulletproof (Until some of you shoots i down perhaps :-)... Her goes...
Step 1.
Add a userdefined field to the ducument that can hold a temporary Unique identifier (50-100 chars)
Step 2.
On Add-button click (Before action) genereate a unique ID and place it in the UDF. Save this uid globally in memory (A UID can be created using .NET's GUID class)
Step 3.
On the action-success use the UID stored in memory and a recordset to retrieve the DocNum.
Step 4.
Get the DI-version of the Document
Step 5.
Clear the UID from the Document (to avoide that generated UID appears two times in the db (You can never be too sure))
Any flaws in this approach?