User_roles is not defined

I have just updated my erpnext after that I am getting an error in my code written in custom script of Item Doctype.
In my another instance which I haven’t updated yet, it is working fine but in my current instance it is not updated it is still working fine.

below is my code:

if(!in_list(user_roles,"Item Create"))


VM340:74 Uncaught ReferenceError: user_roles is not defined
at eval (eval at setup (form.min.js:268), :74:13)
at form.min.js:264
at form.min.js:264
at (jquery.min.js:2)
at Class.trigger (form.min.js:264)
at form.min.js:76
at form.min.js:264
at (jquery.min.js:2)
at Class.trigger (form.min.js:264)
at _f.Frm.setnewdoc (form.min.js:76)

Any idea what could be the cause and what is the solution?

Got the solution now, user_roles need to be changed cur_frm.user_roles .

Edit: It is not giving error but the code is not working and the if condition becomes false.

Ruchin Sharma