Override UI Policy on Child table?

Greg42
Mega Guru

Hi All,

I have a table that extends from "alm_asset". On "alm_asset" there's a UI Policy Show 'Assigned to' that is inherited by all extended tables.   At the moment I'm using a client script to basically .setDisplay() and .setMandatory() on assigned_to field each time "alm_asset" UI Policy does the reverse. I have created a new UI Policy on my exteded table and tried to do it there either by condition or run script but seems like asset policy overtakes the ownership on that field and extended table policy is not run at all.

Is there an elegant way to override this policy - or policies at all? I don't really like the way I am doing it now.

Cheers

Greg

1 ACCEPTED SOLUTION

Kyryl Petruk1
Tera Expert

Hi Greg,



Override field is used for domain separation override, so that's not gonna help you.


The only way I see it can be done is to remove "Inherit" checkbox from the UI Policy on the parent table and create a separate UI Policy for each child table where this UI Policy should apply.


Not the most elegant solution, but I don't think there is way to override the UI Policy.



Alternatively, you could make a client script that will check the current table and based on that will make a field mandatory / non-mandatory.


View solution in original post

5 REPLIES 5

You could do something like this in the script of the UI Policy on the alm_asset table.

function onCondition() {

if (g_form.getTableName() !== 'alm_hardware') g_form.setReadOnly('substatus', true);

}

I used this to avoid making the substatus field read only just on the alm_hardware table when the policy by default sets substatus to readonly on all child tables. This is kind of hacky, but at least you don't have to make any new UI Policies or client scripts. Basically you just script the custom functionality you want in the existing policy.