client script showing error on record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 01:48 AM
Hi Everyone,
I have requirement logged in user country should be map on "Country" variable which is single line text on record producer but im getting the sys id of logged in user not getting logged in user country name.
please see below screen shot.
please let me know what i need to change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 02:05 AM
@Ivan Betev I tried above one method as well but showing the error "There is a JavaScript error in your browser console"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 02:06 AM
@rmaroti and if you open developer tools in your browser and check the error in the console? What does it say?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 02:12 AM
@rmaroti In your script include replace line number 12 with the following line.
var country = usr.location.country+'';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 02:15 AM
@Sandeep Rajput I checked it in background script its working and getting result as I expected but there will be something issue in client script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 02:22 AM
@rmaroti In your client script change the replace the line number 8 with the following.
var coe = response.responseXML.documentElement.getAttribute("answer");