Wanted to show the reference field values based on select box

CDJ
Tera Contributor

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!

1 ACCEPTED SOLUTION

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';
  }

View solution in original post

6 REPLIES 6

Hi @Brad Bowman  ,

 

Yes, After adding current. Variables its showing as expected in addition I'm trying to add active "true "condition as well but its showing all users including active false users.

 

javascript:
  var ret = 'u_is_contractor=';
  var active = 'active=';
   if (current.variables.u_z_onboarding_hire_type == 'contractor') {
    ret += 'true';
    active += 'true';
  } else {
    ret += 'false';
    active += 'false';
  }

 

Thanks!

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';
  }