Workspace, custom field decorator

Roen
Kilo Expert

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...

find_real_file.png

 

find_real_file.png

 

 

1 ACCEPTED SOLUTION

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.

find_real_file.png

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

find_real_file.png

 

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.

 

 

View solution in original post

12 REPLIES 12

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.

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.

 

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 🙂