Sublist items should have a lookup to parent case file
CompletedCurrently the items in a sublist of a case file (for example "documents") are only placed in a folder which marks their relationship to the parent case file item ([Case file list URL name]-[case file item ID]).
It is often needed that we want to get the parent item, from the context of a sublist item (for example for easy filtering). In the partner presentation 4/2018 skybow seem to have recognized themselves that this is a much wanted feature and showed us some custom code that can be inserted into an calculated expression of the lookup column:
var folder = [[@Web.GetFirstValueForQuery('ListXy', '<View Scope="RecursiveAll"><Query><Where><Eq><FieldRef Name="ID"/><Value Type="Text">[[ID]]</Value></Eq></Where></Query></View>', 'FileRef')]];
if (folder && [[FileLeafRef]])
{
folder = folder.substring(0, folder.lastIndexOf('/'));
folder = folder.substring(folder.lastIndexOf('/')+1);
var namesArr = folder.split('-');
return namesArr[namesArr.length-1]+';#';
}
return null;
It would be great if we wouldn't have to put this workaround into a manually added lookup ourselves if we need this lookup/relationship. It would be great if something like this would automatically happen in the background or at least if we could specify during the case file configuration and sublist configuration that this is needed (checkbox) and then those things are automatically added in the background.
-
This was extended in the Dossier (case file) handling on Modern Forms that related folders of sublibraries gets a lookup reference instead of "folder-name-based" referenced subitem-files. Check How to migrate sublibraries to use custom folder name format
Additional with Metadata Inheritance each document in sublibrary can get a calculated reference to the case file.0
Please sign in to leave a comment.
Comments
1 comment