Change the doctype.json with client side script

hi
i have two required fields that are depends on other field , i just need one of these fields then i made a depend on that will hide the second field that i dont need , problem is because those 2 are mandetory i cant just hide the second field i have to change the mandetoy to no mandetory , im thinking about using doctype.js to change the doctype json but i dont know how , have no idea about the client side api that can change the json reqd key to 0 :slight_smile: any idea friends ?

json changes not needed.

You can change a field to mandatory based on some condition using client side code. Check example for frm.toggle_reqd() method.

excellent thanks my friend
where can i find good documentation of the apis thanks

http://frappe.github.io/frappe/user/

Hey @amirtdss
I have a situation like you do.
Is your problem has been solved?