I have 2 different tables with same field properties. For each, I got its form.
Qn: Using a “Menu Item”, in my case “transfer” (in form A), I would like to transfer the details I put on form A to form B. Remember this are 2 different tables!!
If the fields are the same, you can use the transferfields function to assign the values from one table to another table. One example of this is how the system moves data from the Sales Line table to the Sales Invoice Table.
The syntax is as follows:
To.transferfields(FromRecord, InitPrimaryKeys ) Where InitPrimaryKeys is a boolean that (default value TRUE) if set to false, then the ToRecord’s Primary Key values will not be overwritten by the FromRecord.
TRANSFERFIELDS copies fields based on the Field No. property of the fields. For each field in Record (the destination), the contents of the field with the same Field No. in FromRecord (the source) will be copied, if such a field exists.
The fields must have the same data type for the copying to succeed (text and code are convertible, other types are not.) There must be room for the actual length of the contents of the field to be copied in the field to which it is to be copied. If any of these conditions are not fulfilled, a run-time error will occur.