How to customize autoname for child table "Item Customer Detail"

I want to set custom autoname for doctype “Item Customer Detail”. This doctype has field named “ref_code” and I want to set ID of that doctype same as “ref_code”. It must be unique. Is there any way to do this ?