We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

regrading clientscript

shreya_3009
ServiceNow Employee

Hello,
I have a client script where depending on the opportunity filed, i am populating 4 other fields.So this client script is correctly working in workspace, but when coming to native and when i select opportunity field its not populating.Any suggestions could be helpful

 

9 REPLIES 9

sivasankaris
Tera Guru

Hi @shreya_3009 ,

Check in the client script , Make sure you set the UI Type field as ALL.

If this works, please mark it as helpful and please accept my solution...

its all only

RC19
Tera Expert

See if Global checkbox is checked or if your client script is limited to a specific view. Also check "Application" field for the scope.

 

Also put more alerts in your client script for debugging in Native UI and see if your client script is running in first place and if yes, then check at what value it is failing.

shreya_3009
ServiceNow Employee

I have added alert at the top of the script, alert is not triggering in native , its not going inside the script only

1. Does the field on which you wrote your onChange client script exist on form in default view?

2. Ensure that you are updating right field to trigger this. (Hope there is no other duplicate field with same name on default view which is causing this confusion)

3. Verify the client script is in the correct Application scope. Check if there are scope restrictions affecting Native UI.

4. Hope Global checkbox is checked and no specific view is selected.

5. Check if there are multiple client scripts on the same field.

6. See if there are any JavaScript errors in browser console.