Unable to view value in form

Nazhath1
Giga Expert

Hello 

 

I am able to view the value for a filed in list view , but when I open the form, the value gets cleared. I have deactivated all the backend policies, but its still not working.

 

The value is being populated via REST API POST method, using postman

 

Nazhath1_0-1666886865485.png

 

Nazhath1_1-1666886926879.png

 

Please advice!

1 ACCEPTED SOLUTION

@Nazhath1 ,

 

If the issue is happening only on form then most probably there is any client script or UI policy doing this.  Since you can see the name and link for a reference field in the list, it is convincing that record do exist (I beleive clicking on the item name from list view would be opening the catalog item). For troubleshooting purpose I would suggest follow below Procedures:

1. Open the RITM in the middle pan of the servicenow home page and then click on the gear icon available at top right, go to the Developer section and enable the Javascript Log and field watcher. You will see servicenow debugger has open at the bottom of the page

kamleshkjmar_0-1666952473751.png

 

2. Now reload the RITM form and right click on the field on which you are having this issue. I beleive you see this issue in Item field, so right click on that and select Watch field. If watcher gets set then it shows a  bug icon next to the field 

kamleshkjmar_1-1666952527277.png

kamleshkjmar_2-1666952566182.png

 

3. Now reload the form, wait for the form to complete the load and then go to the Field Watcher section of the debugger and see if you see any clent script name or UI policy showing value change from 039c516237b1300054b6a3549dbe5dfc to (empty)

kamleshkjmar_3-1666952622852.png

 

if you see anything like that then you have found your cultpril.

 

Let me know if you find anything.

 

I Hope this helps.

 

Please mark this helpful if this helps and Accept the solution if this solves your issue.

 

Regards,

Kamlesh

View solution in original post

8 REPLIES 8

Hello,

 

1) This error is generally seen when you try to update the value in reference field (Configuration item in your case)which doesn't exist in the referenced table(configuration item  table). 

Check if the value you are trying to update actually exists in your CMDB

 

2) Check the scripts which is setting value of a reference field 

While setting the value of reference through client script, we should set both value and display value like the below:-

g_form.setValue('u_field_reference', value, displayValue) ;

 

3) Check the sys_id of the record you are selecting is there any hypen in the sysid.

 

Please mark my ansawer as correct based on Impact

@Nazhath1 ,

 

If the issue is happening only on form then most probably there is any client script or UI policy doing this.  Since you can see the name and link for a reference field in the list, it is convincing that record do exist (I beleive clicking on the item name from list view would be opening the catalog item). For troubleshooting purpose I would suggest follow below Procedures:

1. Open the RITM in the middle pan of the servicenow home page and then click on the gear icon available at top right, go to the Developer section and enable the Javascript Log and field watcher. You will see servicenow debugger has open at the bottom of the page

kamleshkjmar_0-1666952473751.png

 

2. Now reload the RITM form and right click on the field on which you are having this issue. I beleive you see this issue in Item field, so right click on that and select Watch field. If watcher gets set then it shows a  bug icon next to the field 

kamleshkjmar_1-1666952527277.png

kamleshkjmar_2-1666952566182.png

 

3. Now reload the form, wait for the form to complete the load and then go to the Field Watcher section of the debugger and see if you see any clent script name or UI policy showing value change from 039c516237b1300054b6a3549dbe5dfc to (empty)

kamleshkjmar_3-1666952622852.png

 

if you see anything like that then you have found your cultpril.

 

Let me know if you find anything.

 

I Hope this helps.

 

Please mark this helpful if this helps and Accept the solution if this solves your issue.

 

Regards,

Kamlesh

Hi Kamlesh

 

Yes , when in list view I click the item, it opens the particular record. I will check on your solution

Thank you Kamlesh

 

This worked. I found a catalog client script clearing this value of the RITM form.