In the above code Test Contact form
Name Field display 'contact1' and Reference Field display '0001' at the time of selection.
But issues after the record saved it shows
Name Field display 'contact1' and Reference Field display 'contact1'