Configuring related list layout in a configurable workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2023 04:19 AM
Hi,
I'm trying to change the list layout of a related list in a configurable ("home-made") workspace.
I have tried the following with no luck:
1. Changed the list layout of the related list in the "classic" interface. I have made a layout both for the view of the workspace, and just to make sure, I tried to make one for a view simply called "Workspace" (as I remember having done this before configuring list layouts in a workspace).
2. Found the list in the sys_ui_list table (the related list "List Elements" mirrors the changes done in point 1.
3. Looked for the list in sys_ux_list (apparently, this table does not contain related lists, only the ones in the list section of the workspace)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 12:00 AM
Hi @Arjun11,
I don't think I ever resolved it, I just used the Default view as a workaround. Do let me know if you manage to resolve it. Also, check out the post that I link to in my answer above.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2024 08:23 AM - edited 04-13-2024 08:24 AM
Hi @MagnusSchlamovi,
please let me know, if this helps to solve your issue:
In the UI Builder, when viewing the List - Related component in the Repeater component on your page, the configuration on the right side might look like this:
You can replace the highlighted part in View with a script, you will have a lot a flexibility to set any view you like.
Note, that this value will be used for all related lists of your record, but the script could also be adapted to provide an individual value for each related list.
Your script could, for instance, look like this:
/**
* @param {params} params
* @param {api} params.api
* @param {TransformApiHelpers} params.helpers
*/
function evaluateProperty({api, helpers}) {
// Note, that tableName is the techinical name of the table.
var tableName = api.item.value.table;
// Use the view provided by SN as the fallback (corresponds to @item.value.view).
var viewName = api.item.value.view;
// Overwrite the default view name with a dedicated value for each related list.
switch(tableName) {
case 'Stages':
viewName = 'Workspace';
break;
case 'OtherRelatestList':
viewName = 'OtherView';
break;
}
console.log(viewName);
return viewName;
}
Note, that I left a console.log(viewName); at the end of the script, so the selected view is written to the console of your browser.
Hope this helps.
Kind regards,
Carl