Select a document before @Command(Compose)

View Action Button : @Command([Compose] ; …) creates a document that inherits values from the selected document. There is only one document in the database that I would like used as the parent. If the user is not on the parent is there a way to have the Action Button select the parent? The other alternative would be a “document” action instead of a view action.

Subject: Select a document before @Command(Compose)

I believe you will have to convert your button to a lotusscript button in order to do this.

Then, the steps would look like:

  • Get a handle to the target document from which you want to inherit values, ( view.GetDocumentByKey ( …) )

  • Create a new empty document ( db.CreateDocument )

  • Assign it to the right form ( doc.Form = “MyForm”

  • Copy the values you want from the target document to the new document (doc.Field = targetDoc.Field, etc…)

  • Call workspace.EditDocument to open the new document in edit mode on the user interface.

hth

Nicolas Abesdris

Subject: RE: Select a document before @Command(Compose)

I am leaning toward a document action button. Thanks for your response.

Subject: Select a document before @Command(Compose)

Are you actually trying to create a parent-child relationship or are you simply trying to inherit values from a common document. At the moment I cannot think of any reason why all documents in a database would be children of one document. There are a number of ways of defaulting values without strictly using inheritance. I would use @DBLookups to pull values from a standard location.