duplicating only selected fields.
I would like my client to duplicate a record with option to select fields to duplicate.
So I created a Global table with a text field (Globals::whichchk) in the Header section of the form. The format of this global field is Check box list and displays a value list which has names of all fields on the form. The client can check the box to select the fields he would like duplicate.
I have created a script that uses getvalue(Global::whichchk,1) to check if the first item in the value list is 1 or 0. If it is unchecked then that field in the duplicated record is set to "" (null).
The name of the value list is chklist. It is the list of name. strain, generation, birth date etc.
So the global field Globals::whichchk in the header section of the form shows a checkbox list of name, strain, generation and birth date.
I created a button in the header section which when clicked perfoems the following script.
Go to Recordd/Request/Page (last)
Case (GetValue ( Globals::whichchk ;1) =0;mytable::name="";
GetValue ( Globals::whichchk ;2) =0;mytable::strain="";
GetValue ( Globals::whichchk ;3)=0;mytable::Generation ="";
GetValue ( Globals::whichchk ;4)=0;mytable::Birthdate="";
The Globals table and mytable are not linked.
I get the following error when I click on a check box of the global field.
‘This operation could not be completed because target is not a part of a related record.
I do not know what is wrong.
Can we not have global fields in the header of a form?
Do we need to link global table with mytable ?