Create a New Document taking values from Existing Document

Hi,

I have a view in which there are many documents. In that view i need a button, on click of which it should create a new document by taking only values of six fields as are in the current document. Can anyone help me out on this. Thanks in advance.

Anil.

Subject: Create a New Document taking values from Existing Document

Hi Anil,

I suppose you want to create a new doc by select any doc under current view. Pls correct me if I m wrong here.

To proceed with above mentioned requirement follow these steps:

first of all you have to set Notescollection using db.UnprocessedDocuments.

Then u have to check that user has choose one doc here.

Access/set the selected doc and fetch the required fields.

Create the New doc using workspace.ComposeDocument and set the field value which youhave fetch earlier.

Let me know your feedback…

Piyush

Subject: RE: Create a New Document taking values from Existing Document

Hi Piyush,

Thanks for ur Reply.

This is exactly the same way it should be done.

I have 3 Radio Buttons and Three Check boxes in the existing documents , i need only the Labels as well as field values for the check boxes in the new document. Can you help me out with some code.

Thanks,

Anil.

Subject: RE: Create a New Document taking values from Existing Document

Hi Anil,

I don’t have any ready made code with me rite now.

I m not too sure about how can you get Labels, but if u able to access field value then there will be not a problem with checkbox also. coz you r accessing checkbox value from saved doc.

If u access checkbox value then it wont give u all the value of checkbox, it will only gives saved value.

For lable: if ur no. of field or labels are fixed to fetch then u can saved the fieldname and respective lable in a field and can access based on ur required field name.

But I m love to see ur code how did u have fetch the lable value once u have done. Pls share with us also… and hope u’ll do :slight_smile:

Piyush

Subject: RE: Create a New Document taking values from Existing Document

Sure Piyush, will let you know once that is done :slight_smile:

Thanks,

Anil.