Dialog box and inherit the values from document

Hi everyoneI have a document called ECO that contain a embeded view and in the embeded view action I have a button which suppose to open a dialog box and user can compose a ECOlineitem document which inherit the ECONo from ECO document and user can key in rest of the value in dialog box and save the dialog box and that document should show in embeded view, I have following script when run it did not get the ECOno from the main document and did not save.

Could you please let me know what wrong in the script or should I put the button in view action or out side of embeded ivew…

Dim session As New notessession

Dim workspace As New notesuiworkspace

Dim db As notesdatabase, doc As notesdocument

Dim uidoc As notesuidocument

Dim newuidoc As NotesUIDocument



Set db = session.currentdatabase

Set doc = db.createdocument



Set uidoc = workspace.currentdocument

Call uidoc.FieldSetText( "ECOno" , Trim(uidoc.Document.ECOno(0)))



Call Workspace.DialogBox( "ECOLineItem", True, True, True, False, False, False, "Create New ECO Line Item", doc)



Call uidoc.refresh

Call uidoc.Save

Thanks

Subject: dialog box and inherit the values from document…

You are getting the documents mixed up I think.

The line

Call uidoc.FieldSetText( "ECOno" , Trim(uidoc.Document.ECOno(0)))

Should be

Call doc.ReplaceItemValue( "ECOno" , Trim(uidoc.Document.ECOno(0)))