Remove line 8 (love those line numbers in the new workspace!)
The duplicated record will be the current record immediately after line 7 executes.
Lines 9 & 10, however do not look correct. They will set their target fields to the value of either 1 or 0 depending on whether the value of the two referenced fields in the calculated result are equal (1 ) or not equal (0).
So I've removed line 8 and changed 9 to Set Field [ Inventory::Location ; Stock Transactions::Location In ] and 10 to Set Field [ Stock Transactions::SuppliedFrom ; Stock Transactions::SuppliedFrom ]. That is the correct format right?
I guess since the Duplicate Record function makes the duplicated record the current record, the Set Field functions will be taking values from the newly duplicated record.
Is it possible to copy to clipboard two field values before the duplicate record function, and then paste them after the record function?
Yes, but don't.
Use variables to store those values instead.
copy/paste will destroy any data a user might have copied previously to the clipboard. They tend to get confused and upset when they copy data, then run a Filemaker script and the data they copied is mysteriously replaced by other data copied by your script.
Also the duplicated record will be a duplicate of the original except for certain auto-entered values. So in many cases, the data from a related record will still be accessible from the duplicated record--but not if the relationship is based on an auto-entered primary key that is now different in the duplicated record.
So I've got Set Variable [$LocationIn ; Value: Stock Transactions::Location In] which occurs before the Perform Find function
Then use Set Field [Inventory::Location ; $LocationIn ] which occurs after the duplicate function
Would this potentially have problems if the location field is part of a value list, which allows user entry of other values?
opps, ignore line 14, i will delete that now