- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2020 05:10 AM
Hi,
I am trying to create a custom field decorator.
The decorator should copy the text in the field it is attached to, to the clipboard.
How do I create a custom field decorator??
I have tried creating a now-cli component that does this, but when I create the decorator and attach it to the field as a UI component, it just does nothing...
Solved! Go to Solution.
- Labels:
-
Now Experience UI Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2020 10:51 AM
thank you for the suggestions Drew, it helped me get the motivation to rumage around more to find the issue.
I was able to figure out why a UI component didn't natively work as a field decorator.
When you create a field decorator from the menu.
It does not set the form position to contextual side bar.
as the UI component MUST be set as a contextual side bar(maybe related item, didn't test this) to be loaded in,
even if it is a field decorator
I had to go to sys_declarative_action_assignment.list
where I found my decorator missing the form position.
Set it to contextual side bar through the list view, not the form view.
As the form view hides this option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2020 01:16 PM
definetly worth putting in a case on it.
I have just made a simple business rule to check if it's a field decorator then set the form position on insert.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2020 10:54 AM
Ok, so I had a simple test component in out dev instance so I added it to all the reference fields in the system to see what would happen and I got the samething you did, no console log messages.
After reviewing what the browser shows was in the shadow dom I concluded it did not render it at all. So I'm going thru the script that is for one of the others that is there and it looks like in ServiceNow needs more documentation for there components because it looks like the Field Decorators have to be built in a different way and there are action handlers that you need to respond to for it to work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2020 10:57 AM
sys_declarative_action_assignment.list
find the field decoration, set the form position from none to context side bar.
then the decorator works.
Thank you for helping me in this wild goose chase 🙂