Subform file insert

Subform file insert

Is there a way to get a subform file field insert to work ?

The same script works ok for other fields but not if the field is a file field

Deluge show the file field as string, and it works to copy across forms but inserting in a subform fails with this error:

Error details:
Error in executing On Edit - On Success script
Unable to update the value to row1.Documents. Line:(5)

'row1' has no matching records. Unable to update the value row1.Documents. Line:(5)

insert script used

Collection= Parentform[ID = some-source.ID];
row1=Parentform.Subform;
row1.Documents=input.Documents;  -- a single file
Collection.Subform.insert(row1);


I did try at source to insert into destination (on submit) and from destination to fetch the source and insert (on load) - same result and error type.

Update:

My code was bad - so, maybe check your code - it should work :)

The above example worked when used ON SUCCESS