[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

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

2 Solutions
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... ;)

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 !

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now