- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2018 08:01 AM
Hello Experts !
I would like to apply a Client Script on all CMDB classes. My requirement is to display a field as mandatory when another one changes to not empty, as well as the reverse.
I successfuly did this on a cmdb_ci_server with a (well, two) simple client script, and I'd like to apply this on all the cmdb. I thought this would be fairly simple, but I'm either wrong or missing something.
Would some kind soul be able to guide me ? Obviously, I'd like to avoid creating two Client scripts per CMDB class 🙂
Thanks a lot for your help !
Regards,
Florian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 06:28 AM
Hi Florian,
If i understand your requirement properly you need the owned by field to be mandatory when the support group changes to not empty and vice versa?
If you tick the 'reverse if false' tick box and set the condition to be 'support group is not empty' then when the condition is matched the policy action will make the owned by field mandatory, when the condition is not matched the field will be non-mandatory. It will change dynamically on the form as the field changes.
Basically, UI policies can operate on load and, to an extent, on change. If your on change conditions go beyond a simple field value change or you need to do more than make a field mandatory/read-only/visible then you'll need a client script, otherwise you can use a UI policy.
Cheers
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 06:16 AM
Hello David,
thanks for your insight 😉
As I answered to Brian, it was indeed the Inherited checkbox.
I would gladly have done this with UI Policy, unfortunately my triggering condition is onChange and not onLoad (owned_by mandatory when support_group changes).
Regards,
Florian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 06:28 AM
Hi Florian,
If i understand your requirement properly you need the owned by field to be mandatory when the support group changes to not empty and vice versa?
If you tick the 'reverse if false' tick box and set the condition to be 'support group is not empty' then when the condition is matched the policy action will make the owned by field mandatory, when the condition is not matched the field will be non-mandatory. It will change dynamically on the form as the field changes.
Basically, UI policies can operate on load and, to an extent, on change. If your on change conditions go beyond a simple field value change or you need to do more than make a field mandatory/read-only/visible then you'll need a client script, otherwise you can use a UI policy.
Cheers
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2018 06:53 AM
True, I was stuck on the onChange logic I guess and forgot UI Policy does it too.
Thanks for your insight, worked perfectly and way more simply.
Cheers,
Florian