Hide which worked in v10 not working in V11

I used this in erpnext v10 and it worked fine in custom script


This is a custom field of type small-text

But this isn’t working in v11.

Can anyone help me out whats the issue

This is the field named dat

I am trying to hide it using custom script and its condition to hide it using custom script coz its a field in custom dialog. If I use hidden:1 where I am creating the field, although its hiding by that way but it is also not letting me fetch the value. So need to do it by jquery.


Can anyone tell me whats wrong I’m doing.


This is the exact code which worked on v10 but not in v11.

Any suggestions

cur_frm.add_custom_button(__("Hide"), function(click) {
var d = new frappe.ui.Dialog({
    'fields': [
        {'fieldname': 'ht', 'fieldtype': 'HTML'},
        {'fieldname': 'today', 'fieldtype': 'Date', 'default': frappe.datetime.nowdate()},
	{'fieldname': 'htt', 'fieldtype': 'Small Text'}
    primary_action: function(){
d.fields_dict.ht.$wrapper.html('Hello World');


Figured it out. Had to use


@nikzz Any way to hide a particular action in action dropdown using hide.