What method is called when I open a new doctype?

Hey there,

I need to set a default value on a field in a doctype that depends on another doctype’s field. For that I think that I need that when I open a new project, it load me the info from the other doctype’s field. I can’t with custom fiel or if someone can help me giving me a new idea. plizz I’m stock

Thanks

you have to code it in custom script

frappe.ui.form.on(“Your Doctype”, “onload”, function(frm)
{
//do something here
});