Web form client scripts v11 not work (console error)

I added client script as below to web form v 11 as per the following link guide, but the scripts not work with me. even I reloaded page and cleared cache too.

client script

// Set Field Property based on value
frappe.web_form.on(‘business_registration_type’, (field, value) => {
if (value == ‘Domestic’) {
frappe.web_form.set_field_property(‘telephone_number’, ‘reqd’, 1);
else if (value == ‘Foreign’) {
frappe.web_form.set_field_property(‘telephone_number’, ‘reqd’, 0);

console error

Uncaught TypeError: Cannot read property ‘fields_dict’ of undefined
at frappe.web_form.wrapper.get_field (web_form_class.js:99)
at frappe.web_form.wrapper.on (web_form_class.js:129)
at Object.frappe.init_client_script (supplier-registration-application?new=1:390)
at web_form.js:40

And this

Please advise…


i am facing same issue can u please help me to solve this issue ??
In my case i am creating a sales order through website user only having role customer but while i am creating new sales order then item not display for normal user i have written one custom script and it will work fine there but for website user not able to fetch the item based on customer and company can u please help me

is there any update on this?