Make readable doctype

I have three doctype for ex A,B and C after selecting A DOCTYPE IN doctype C that particular doctype in A should be in read only mode.i know how to make form read only after some event but how could I achieve this scenario.any help will be more helpful.

Hi @Hardik_Mehta! Are you referring to a Link Doctype inside a doctype?

@creamdory i have to disable particular doctype based on event in other doctype

You mean you want to make link doctype in read only?

frm.set_df_property("field_name", "read_only", 1);

2 Likes

@KanchanChauhan thank you for your response.but i have to disable that particular doctype only.for example if some employee is selected in leave module then that particular employee’s doctype should be in read only mode.

Try this:
cur_frm.set_read_only();

1 Like

@KanchanChauhan i have to make that employee doctype readable after selection of that employee from leave doctype.

Hi @Hardik_Mehta,

It would be better if you make frappe call on employee form refresh event & check if the current employee is selected on your leave doctype & make form read only as per solution suggested by @KanchanChauhan.

@suyash will it not required to traverse all the leave doctypes created previously.