During imports you can disable the auto-enter actions, but export then import seems way to complex for this need.
Try using "duplicate Record" instead.
You can use a find or Go To Related record to isolate your record to be duplicated, duplicate the record and then return to your original layout.
Note of Caution: Go To Related Record can fail to work correctly under circumstances where there are no related records or (as in this case) the user might accidentally trigger the script from the bottom, blank portal row. If you use GTRR, add a check to avoid these possibilities.
Oh man, I was looking all over for the option and found it only appears after you press OK in the Import Field Mapping dialog box. :smileytongue:
As far as using export/import goes, I probably wasn't clear enough in my post--I am copying the entire PO. I use Duplicate Record for the main record, and Export/Import for the line items.
You might still find duplicate record as the simpler way to go.
You can isolate the related records in a found set and loop through them duplicating (and updating the matching keyfield so it links to the newly duplicated parent record) each one in turn.
I may have to go that way at some point, as export/import is not web-publishing compatible....
Here is a sample script that will duplicate your parent record and its children.
Unsort // added due to autosort in FM10
Set Variable [ $recordnum; Get ( RecordNumber ) ]
Commit Records [Skip Validation; No Dialog]
Set Variable [ $parentID; pkParent_ID ]
Go to Record [ $recordnum ]
If [ not IsEmpty ( pkChild_ID ) ]
Go to Related Records [ Show Only Related Record; From table: "Child"; Using Layout:: "Child Layout" (Child) ]
Exit Loop If [ fkParent_ID = $parentID ]
Set Field [ fkParent_ID; $parentID ]
Go to Record [ First ]
Go to Layout [ Original ]
Go to Record [ Last ]
Sort // optional sort if you want it to sort back to the way it was.
So the blessed Duplicate Record command re-performs lookups and there doesn't seem to be a way to shut it off.
How would you do this script if you wanted to retain the original data? As far as I can tell you would have to creat a new record, then copy and paste all of the fields from the old record to the new record...
Only the auto-entered serial number will change and this is desirable behavior in almost all cases. All other fields should remain unchanged and wont need to be "copied over from the original".