Integrating UI Pages in Form Sections

kungfuu72
Giga Expert

I know that you are able to integrate UI Macros into any form section that you create, but can you integrate UI Pages into a form section that you create ?

 

I am currently developing a custom application in ServiceNow and the current out-of-box form-dictionary field layout is very limiting. I need a very dynamic form for my users to work with.

 

I know that UI Pages are similar in syntax to UI Macros, but the advantage of using a UI Page is the client script + processing script. If I create a form in a UI Page, I can map the UI Page form values back to the dictionary values for post-processing, but UI Macros do not make this process very convenient like the UI Pages does.

 

If this is not possible, I might end up making my entire interface my UI Page, but ideally, I'd like to have some dictionary fields visible in the initial section, and my customer UI Page form in another section.

1 ACCEPTED SOLUTION

James_Neale
Mega Guru

UI Macros and UI Pages both use the same XML/Jelly/JS syntax with UI Pages making a distinction between HTML, client and processing scripts for ease of use. You can actually just put all of these scripts in the HTML section which I have done many times and it works fine. The main difference is a UI Macro must be included somewhere; you can't post an action to a UI macro on it's own.



The OOB layout might be limiting in some ways but it's designed to be easy to use for non-programmers (personally, I think it's pretty flexible for 95% of the time) and this is the core reason ServiceNow is so powerful. Bear this in mind when considering what you are building, always build everything for the next person. If it is difficult for you to build just imagine how difficult it will be for someone other than you to debug, fix and maintain it. (Been there!)




You might find more help if you can explain what it is that you are trying to do that requires such 'dynamic' capabilities. All of my UI Pages are built because they are not form based. It will be a tool or a specific data view, or based on some other arbitrary idea that doesn't fit the standard record-form model. It sounds like you want the form capabilities but not the form layout - this is something I think might be a stretch too far.



- James


View solution in original post

5 REPLIES 5

kungfuu72
Giga Expert

I've chosen my solution to just use the default form layouts, but am running into issues with form sections, but I will answer these questions in a separate post. Thanks for the discussion.