How to copy items or copy fields from one document to another

Well folks, after spending some time reading this forum and then going back to my Lotus design books, I figured this out using formula language instead of Lotus script. This may not be the most efficient way, but it works great and fast using an action button. The form actually has over 200 fields, but remember, I only wanted to copy over data from the first ~30. (see my previous post). After a user opens a new document using the desired form, they can click on an action button(button only appears if @isnewdoc), that will let them choose from a list of previous documents. (choice list is presented in a view that has uniquedocid hidden in the first column.) The uniquedocid is used to then populate the desired fields of the new document using @getdocfield

<<>>>>

REM {choose the facility to pull general information from. Value returned is the document’s unique ID from column 1. this is done in case plant name is same};

temp1:= @PickList([Custom]:[Single];“”:“”;“AllFacilitiesView”;“Plants Surveyed”;“Sort alphabetically by clicking on the column header for plant names, then select the plant you wish to copy data from:”;1);

REM {use the document unique ID in column one as the key for picking the other desired field values from the source document and insert them into the fields on the new document};

FIELD Plant_Name:= @GetDocField(temp1;“Plant_Name”);

FIELD Address:= @GetDocField(temp1;“Address”);

FIELD City:=@GetDocField(temp1;“City”);

FIELD State:=@GetDocField(temp1;“State”);

FIELD Zip:=@GetDocField(temp1;“Zip”);

FIELD Office:=@GetDocField(temp1;“Office”);

FIELD Contract:=@GetDocField(temp1;“Contract”);

FIELD Product:=@GetDocField(temp1;“Product”);

FIELD Mailing_Address:=@GetDocField(temp1;“Mailing_Address”);

FIELD Mailing_City:=@GetDocField(temp1;“Mailing_City”);

FIELD MaiingState:=@GetDocField(temp1;“MailingState”);

FIELD MailingZip:=@GetDocField(temp1;“MailingZip”);

FIELD Location:=@GetDocField(temp1;“Location”);

FIELD Location_City:=@GetDocField(temp1;“Location_City”);

FIELD LocationState:=@GetDocField(temp1;“LocationState”);

FIELD LocationZIP:=@GetDocField(temp1;“LocationZIP”);

FIELD Proprietorship:=@GetDocField(temp1;“Proprietorship”);

FIELD OtherOwner:=@GetDocField(temp1;“OtherOwner”);

FIELD Other:=@GetDocField(temp1;“Other”);

FIELD Name1:=@GetDocField(temp1;“Name1”);

FIELD Name2:=@GetDocField(temp1;“Name2”);

FIELD Name3:=@GetDocField(temp1;“Name3”);

FIELD Name4:=@GetDocField(temp1;“Name4”);

FIELD Name5:=@GetDocField(temp1;“Name5”);

FIELD Name6:=@GetDocField(temp1;“Name6”);

FIELD Name7:=@GetDocField(temp1;“Name7”);

FIELD Name8:=@GetDocField(temp1;“Name8”);

FIELD Name9:=@GetDocField(temp1;“Name9”);

FIELD Name10:=@GetDocField(temp1;“Name10”);

FIELD Name11:=@GetDocField(temp1;“Name11”);

FIELD Name12:=@GetDocField(temp1;“Name12”);

FIELD Name13:=@GetDocField(temp1;“Name13”);

FIELD Name14:=@GetDocField(temp1;“Name14”);

FIELD Name15:=@GetDocField(temp1;“Name15”);

FIELD Name16:=@GetDocField(temp1;“Name16”);

FIELD Name17:=@GetDocField(temp1;“Name17”);

FIELD Name18:=@GetDocField(temp1;“Name18”);

FIELD Name19:=@GetDocField(temp1;“Name19”);

FIELD Title1:=@GetDocField(temp1;“Title1”);

FIELD Title2:=@GetDocField(temp1;“Title2”);

FIELD Title3:=@GetDocField(temp1;“Title3”);

FIELD Title4:=@GetDocField(temp1;“Title4”);

FIELD Title5:=@GetDocField(temp1;“Title5”);

FIELD Title6:=@GetDocField(temp1;“Title6”);

FIELD Title7:=@GetDocField(temp1;“Title7”);

FIELD Title8:=@GetDocField(temp1;“Title8”);

FIELD Title9:=@GetDocField(temp1;“Title9”);

FIELD Title10:=@GetDocField(temp1;“Title10”);

FIELD Title11:=@GetDocField(temp1;“Title11”);

FIELD Title12:=@GetDocField(temp1;“Title12”);

FIELD Title13:=@GetDocField(temp1;“Title13”);

FIELD Title14:=@GetDocField(temp1;“Title14”);

FIELD Title15:=@GetDocField(temp1;“Title15”);

FIELD Title16:=@GetDocField(temp1;“Title16”);

FIELD Title17:=@GetDocField(temp1;“Title17”);

FIELD Title18:=@GetDocField(temp1;“Title18”);

FIELD Title19:=@GetDocField(temp1;“Title19”);

FIELD CodingType:=@GetDocField(temp1;“CodingType”);

FIELD Coding_1:=@GetDocField(temp1;“Coding_1”);

FIELD Coding_2:=@GetDocField(temp1;“Coding_2”);

FIELD OtherStatus:=@GetDocField(temp1;“OtherStatus”);

FIELD Othercoding:=@GetDocField(temp1;“OtherCoding”);

FIELD What:=@GetDocField(temp1;“What”);

FIELD Labels:=@GetDocField(temp1;“Labels”);

FIELD Commodity:=@GetDocField(temp1;“Commodity”);

FIELD Commodity_1:=@GetDocField(temp1;“Commodity_1”);

FIELD Commodity_2:=@GetDocField(temp1;“Commodity_2”);

FIELD Commodity_3:=@GetDocField(temp1;“Commodity_3”);

FIELD Commodity_4:=@GetDocField(temp1;“Commodity_4”);

FIELD Commodity_5:=@GetDocField(temp1;“Commodity_5”);

FIELD Commodity_6:=@GetDocField(temp1;“Commodity_6”);

FIELD Commodity_7:=@GetDocField(temp1;“Commodity_7”);

FIELD Commodity_8:=@GetDocField(temp1;“Commodity_8”);

FIELD Commodity_9:=@GetDocField(temp1;“Commodity_9”);

FIELD Season:=@GetDocField(temp1;“Season”);

FIELD Season_1:=@GetDocField(temp1;“Season_1”);

FIELD Season_2:=@GetDocField(temp1;“Season_2”);

FIELD Season_3:=@GetDocField(temp1;“Season_3”);

FIELD Season_4:=@GetDocField(temp1;“Season_4”);

FIELD Season_5:=@GetDocField(temp1;“Season_5”);

FIELD Season_6:=@GetDocField(temp1;“Season_6”);

FIELD Season_7:=@GetDocField(temp1;“Season_7”);

FIELD Season_8:=@GetDocField(temp1;“Season_8”);

FIELD Season_9:=@GetDocField(temp1;“Season_9”);

FIELD SurveyDate:=@Today;

@Prompt([Ok]; “Facility Copied”;“Only certain general information fields from the plant you selected will be copied to this form. No survey answers are copied from the previous survey”);

@True

Subject: How to copy items or copy fields from one document to another

What was the problem with using script for this? Wouldn’t it be a lot easier?

Subject: RE: How to copy items or copy fields from one document to another

Probably so. I’ve had one 3 day class in LS, so I couldn’t figure how to get it to work and couldn’t find a solution here. The formula language worked fine though.