- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:11 AM
Hi all,
- I'm looking for a request, if "assigned to" is a some perticular user (reference to sys user table) then need to clear the value and revert back the changes on page.
I'm trying the below script but it's not working as expected, it's working for every user not to specific to user sys Id.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:28 AM
Hi @Vijaykumar K ,
You are using 'if' condition and you are using ';', so it is not entering the condition.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:15 AM - edited 10-27-2023 02:25 AM
Hello @Vijaykumar K
Please use this
var assign = g_form.getValue('assigned_to'); instead of your getReference.
and in the if condition you have used ; semicolon at last please remove that as well.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:30 AM - edited 10-27-2023 01:30 AM
@Vijaykumar K Your script is onChange, what is field field name for which you are using it?
if it's assign_to, then directly use newValue == 'sys_id' (however recommendation would be not to hardcode it.
Best regards
Suyog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 01:26 AM
@Vijaykumar K Minor observation, kindly avoid use of hardcoded sys_id in script, you should save it in system property and fetch is from scratchpad.
it would be easier in terms of maintenance for future purpose, also if sys_id changes due to any reason you don't need to go in code and change it, an update in property would reflect changes everywhere.
Best regards
Suyog