- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
If you read the first part of my blog you know how to create a workspace for you custom app and configure lists and simple record page. Now let's look into that in a little bit more details. Usually almost all work in any application is done via forms and buttons, so that what we're going to start with.
Views
When you were creating workspace you probably noticed that ServiceNow created a new view for every table you specified in Workspace Builder. Of course, you can just use Default view, but I think it's a good idea to have a separate view for workspace, so let's keep it. In the custom app I'm using for this post new view was called "Workspace Home Automation 0" which is kind of ugly from my point of view, so I decided to create another one. Of course, you don't have to do it, but what if you did? How would you tell your workspace which view to use?
That's where it becomes less easy and obvious. Right now there is no easy way to set the same view for all tables in the UI. But, there is a way to do it in backend. Object you're interested in is called UX Application, you can access it via Now Experience Framework -> Experiences. To access it from UI Builder, select Experience -> Settings -> Advanced settings.
You'll see the configuration of you Workspace and that's where you set up the view for your tables. In the related list change the value of view record to the view you'd like to use in the workspace.
The only thing you need to do now is to configure this view for all tables you're going to show in the workspace.
Journal fields
Before we talk about buttons there is one more topic I'd like to discuss. If you have comments or work_notes on your form, you probably noticed that the record looks like this in workspace:
You can leave it be this way, but I prefer to see comments only on the right side of the screen. But if you remove journal field from the view or use UI policy to hide it, it will also be hidden in activity stream. So, the proper way of removing comments and work notes looks like this:
- Go to Now Experience Framework -> Configuration Settings -> UX View Rules Configurations and create a new view rule config for your workspace.
- On Workspace View Rules related list click New and create new view rule.
- Select required table and view, then go to Form Settings and select Hide Journal Input Fields.
- Finally, go to your UX Application (see previous paragraph), create new viewRuleConfigId page property and put sys_id of your view rule config (step 1) to value field.
Related lists
Last element that I'd like to mention in this post is related lists. Related lists are configured in old UI for your "workspace" view and they magically appear on the record. However, there is one interesting bug found by @Shane41 . When you click on a related list in workspace a default "active=true" filter applies to all related lists, even if active field doesn't exist in the table. I'm not sure if this bug appears on all instances or not (so far I saw it on 2 instances), but I think it's worth mentioning.
The reason why it happens is because additionally to fixed query (preconfigured when you created related list) it's possible to filter records dynamically using filter field on the related list component.
By default it's empty, which looks like no additional conditions are applied, but if you open UX Macroponent Definition for your page (sys_ux_macroponent) and search for list_related component in Composition field, you'll notice "active=true" hard-coded query.
This query will be automatically applied to all related lists on your record and cause wrong data being displayed. One way of fixing it can be adding item.value.query to filter field.
In the next part I'm going to talk about buttons and how to configure them for different scenarios.
- 4,246 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.