Problems composing a new doc based on an existing one after I save it

Hi, I have an application that uses a couple of forms. One to hold details of the drive and one to hold details of the fault with that drive. Users open up the drive form and hit a button to report a fault. This runs the following code which changes the status of the drive (to offline) and composes a fault form based on the current drive document. Problem is that intermittently the fault form is created based on the wrong drive.

@Command( [EditDocument]; "1" );
@If(DriveStatusMech != "Removed"; @SetField("DriveStatusMech";"Offline");"");
@If(DriveStatusFinal != "Removed"; @SetField("DriveStatusFinal";"Offline"); "");

FIELD saveoptions:="0";
@Command( [EditDocument]; "0" );

@Command([Compose];"";"Fault Details")

It always seems to be the drive below the current one on the view that is used to generate the new form. My guess is that when the document gets saved it changes the order of the view temporarily and this affects the Compose command with inheritance of key fields. Has anyone seen this problem and can you offer me a solution.

Thanks, Andy

Who is Participating?
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.

Hi andyhines,
The inheritance should be from the open document, or on the one where the button is pushed.  If I have two open documents, A & B, and push the button on B, then the inheritance will be from B.  That is if your action button is on the form, and not the view.

Works fine with two, three documents open, saved, unsaved.

The fields on the copy doc are set to the field values i.e. fieldone formula = fieldone

Tested 6.5.3, Windows XP.

This may be one of those times when you have to hover over the users and see what they're doing... ;)


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
In a worse case scenario, you can use a button to create a new doc and copy the fields  that you want over manually.
Using LOtus Script gives you a little more control.

If you want , I can post what I use.

 I hope this helps !
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.