I would try with:
It worked fine in the following context:
ev=Evaluate(|@SetField("$Ref"; @GetDocField("|+parunid+|";"$Ref"))|, doc)
Call doc.ComputeWithForm(False, False)
The form which was used to compute with did not have $Ref field.