UI Policy & field color

rickw1
Giga Contributor

So, this is an issue I'm facing at the moment:

I like the condition formatter of UI Policy, but instead of making a field mandatory or read only, I just want to set a background color for those fields.

Would this be possible in an easy way?

2015-08-28_16-28-53.png

Desired result:

Both background colors: orange

12 REPLIES 12

David O'Brien (Cloud Sherpas) schreef:



You're running this on table x_medt2_ihs_it_support_request, correct?   That looks to be a custom table.   Does the table name actually have a u_ before it?



True, its a scoped application.


The table name doesn't contain u_


Ah, sorry about that.   It's possible that you aren't able to set the style with this script in a scoped application.   So I'd go back to the suggestion to use Styles instead.


Is the UI Policy in the same scope?   Maybe that'll help.   Though I'm not sure how you could even create a UI Policy against something that's not in the same scope.


rickw1
Giga Contributor

rfedoruk schreef:



Is the UI Policy in the same scope?   Maybe that'll help.   Though I'm not sure how you could even create a UI Policy against something that's not in the same scope.


Yes, both the form as the UI Policy are in the same application/scope.


Unable to get this working on the REQ form.


Have the UI Policy record setup when to apply


Requested for.VIP is True



Run this script:


function onCondition() {


  var requestedFor = $('sys_display.sc_request.requested_for');


  requestedFor.setStyle({fontColor : "red"});


}



But it will not fire!!



Anyone with a hint?



Thanks