xPage - Beginner question on creating documents

I’m starting to play around with xPages in earnest.

My question is, When creating a new document from an xPage, how do you pre-populate any field on the new document from the current document.

In the client you can use inheritance, or create the document in backend script and then open the document.

What’s the “best practice” method to achieve this.

What I’m trying to do is simulate a very Notes client type page of having a document like “Company” on the screen and then multiple related documents like “Contacts”. I’d like to try displaying the contacts in either a view or repeat control, but first I’d like to know the best way to create the contact and associate them with the company. My understanding is that we no longer need to duplicate fields like “company name” etc. But we will still need a shared key.

Any advice would be appreciated.

Thanks!

Subject: I would create the contacts as response documents

Hi David,

I would create response documents. You can use the simple action “Create Response Document” in a button on the Company form. This will allow you to include the contacts in a view nested under the company. Plus you will have all the Notes functions in JS for collecting/processing response docs.

Regards,

John