How to configure a UI policy to hide a field on task on extended tables?

aansell
Mega Expert

Hi,

I am trying to create a UI Policy to hide the Task table filed 'time_worked' when users who do not have the role 'timecard_user' are looking at Requests.

Unfortunately the UI policy doesn't work when the specified Table is 'Task' (although it does work when the specified table is 'Request') can anyone advise what is wrong with the condition (see screen-shot) or my script?

Thanks,

Arthur

------------------------------------------------------------------------------------

function onCondition() {

// we only want users in the group 'Time Card Users' to see this field

if (g_user.hasRole('timecard_user')) {

                  g_form.setDisplay('time_worked', true);    

}

//Non 'Time Card Users' we dont want to see the field

          else

                  g_form.setDisplay('time_worked', false);

        }

1 ACCEPTED SOLUTION

preddy
Kilo Guru

Hi Arthur,



Can you please enable the Inherit checkbox in UI policy. This will applies to the extended tables also.



Please hit like or mark the response as helpful or correct based on the impact!


View solution in original post

11 REPLIES 11

Glad it worked for you, I am just curious to know why UI policy is created on task table if you are using it only on the request level (based on your condition)?



Thanks


Please Hit like, Helpful or Correct depending on the impact of the response


Well the request type was just was just the first one I had set up, I do want it to to a number of different child tables we have created. There are 5 child tables and I assumed that I would need a condition for each of them but as you advised that was not needed. Once the condition was removed the filed is hidden or shown as required so again thanks for the advice



Arthur