Variable Editor in Display Form in Workspace does not wokr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2024 01:20 PM
I added a variable editor UI Formatter to a form to display what was originally entered by the requester in a separate view from the default view.
I intended to add this as a different tab using the display form component in the workspace but noticed the UI formatter refuses to display in that component. Works just fine in the normal form component but I want it read/display only.
Is this a bug or did I miss something?
Display only form
View outside the workspace:
Using Form component (added a UI policy to make it read only so got there eventually, but not ideal on what I was trying to go for with using the Display Only Form component)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Ahh, I found it.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2199466
So, the custom UI Macro has to be in the Global Scope, it won't work if it's in a scoped app. Also, the name of the custom UI Macro MUST start with com_glideapp_servicecatalog_veditor. Then you can add something to the end of it. I think this is why it has to be global, because if it's scoped, then it puts the scope name in front of it. Apparently workspace only works with formatters who call UI Macros that start with com_glideapp_servicecatalog_veditor. So, you'll have a UI Formatter that points to this UI Macro. After you do this, you'll need to remove the variable editor and then re-add it.
I tested this, and I thought it didn't work at first. However the crazy thing is that the variable was there. It just didn't look like a variable editor, it looked like a normal field. Pretty slick.