I am stuck with a very peculiar situation, my client side script is doing something which has no valid reason in my limited knowledge. My client side script works fine with v4 in un-hiding the fields but in v5 its unhiding only fields in a given section.
Basically there are fields in 2 sections and only fields of one section are showing after the custom script execution. The fields in the 2nd section are not showing at all after the execution of the script.
I have checked that the execution of the script is happening but the fields are not showing.
Just trying to take a stab at this. Looking at function sm1 and sm2… shouldnt the 2nd parameter of toggle_display be “true” instead of “tt”? tt seems to be your tool_type field. Similarly for toggle_reqd?
function sm2(fd1,fd2,tt){
frappe.msgprint("sm2");
for (var i in fd1){
cur_frm.toggle_display(fd1[i],true);
cur_frm.toggle_reqd(fd1[i],true);
cur_frm.toggle_display(fd2[i],true);
}
}
@bohlian I have tried with true as well but it is not working as well
There seems to be something which is conflicting with sm2 function but I can’t seem to figure out the problem.
@bobzz_zone You can check the full gist, its quite evident from there as to how I have called the function sm2
It turns out that the default option in the switch case was being called. Removing the default case does resolve the issue but I am still not able to find the reason why the default option is being called.