How to validate the field attach in doctype, If I want to use custom script?

Hi, People

I need to explain how to do this thing.

In Doctype Oportunidad, has five field type attach, but I need to make sure something is attached.

I do this Script

frappe.ui.form.on(“Oportunidad”,“refresh”, function(frm)
if (!=’ ')
msgprint(“Field is empty”);

Look mv is a fieldtype like attach in my doctype but I don’t know how to do this validation. ( !=’ ')

Can I help me or show some documentation about that.

thank u

if (!


Thak you, Work It

But to attach first I have to save the doctype, there is a function that validates that the document was saved

The script complete is
frappe.ui.form.on(“Oportunidad”,“validate”, function(frm)

if (( || ! ||“”) && frm.doc.estado==“Borrador”) {
msgprint(“Favor de adjuntar información necesaria”);
return false;

Any function that has the save value the doctype ?

I found the solution about this validation, I using the var workflow.

Thank u