- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 04:47 AM
Hi All,
Need suggestions on below requirement
1. Wanted to show the reference field values "Employee name" reference table is sys_user.
2. Based on select box "Hire Type" with options "Contractor and Employee" so the requirement is if user selects Contractor hire type then in employee name field it should show only contractor users orelse employee users
In user table there is a "contractor" checkbox if its checked those are contractor users if its unchecked those users are employee
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 06:06 AM
If you always want only active users, add it to the beginning:
javascript:
var ret = 'active=true^u_is_contractor=';
if (current.variables.u_z_onboarding_hire_type == 'contractor') {
ret += 'true';
} else {
ret += 'false';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 07:15 AM
You can use a reference qualifier like this:
javascriptt:var ret='u_contractor='; if(current.u_hire_type=='Contractor'){ ret += 'true';} else {ret+='false'};
With only one t in javascript, where u_contractor is the field name on the sys_user table, u_hire_type is the select box field name, and 'Contractor' is the select box choice value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 07:43 AM
Hi @Brad Bowman ,
Thank you so much for your response!
I've tried this qualifier script but When I select Hire type as "Contractor" all users are showing except contractor users . Could you please guide me on this.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 07:48 AM
Hi @Brad Bowman ,
I've tried this qualifier script but when I select Hire type as "Contractor"its showing all users except contractor users.
Could you please guide me on this.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 03:23 AM
That likely means the if statement is not being met. Did you replace 'u_hire_type' and 'Contractor' to match the field name and value (not Label) of your Choice record? Is the reference and select box a field on a table form, or a variable on a Catalog Item? If it's the latter you would use current.variables.u_hire_type to refer to the select box variable, but everything else should be the same.