Get value dynamically of a vendor field from Group in Client script

tariniprasad
Giga Contributor

Hi Team

I have a requirement. On Service operation workspace change request, requested by and assign to field cannot be same when the Workgroup vendor is AV Technology.

What I have:

For that I wrote a On-submit client script and Script Include (Client callable). In Client script for fetching vendor details (Reference field), I used dot walk to vendor field and used sys id of particular vendor in 'If' condition. Using sys id, its perfectly working when those two field are same on saving the form.

My question is:

As I know, using sys id is not a best practice in ServiceNow, is there any other way to fetch the Vendor field value dynamically?

5 REPLIES 5

Share updated script and add alert in client script for vendor and check where exactly it's returning