Filter an embedded list

CN-L
Giga Contributor

Is it possible to filter/refresh an embedded list based on the value of a variable when it changes?

 

When creating a new update set, when the admin/dev enters the work reference number, I would like the list to return results of all update sets that contain that same work reference number within their name

 

Update Set Related List Example.jpg

1 ACCEPTED SOLUTION

CN-L
Giga Contributor

It's not the prettiest however I have found a solution... After creating the scripted sys_relationship and adding the embedded list, I've used an onSubmit Business Rule which checks to see if an update set already exists with the same work reference number and version. If so, an error message is displayed to advise, however this behaviour seems to refresh the embedded list, allowing you to see all matching update sets - then, you just need to amend the version number manually.

View solution in original post

3 REPLIES 3

lauri457
Giga Sage

Do you mean for client-side changes? No, the embedded lists are pretty much static and served from the server. But you can create a UI Macro and add the ui macro as a formatter to the view. This will let you display the list however you want with whatever functionality you can implement.

 

Creating a scripted relationship that will work when you save the record can be achieved easily with a sys_relationship but you already have one defined so maybe this is not what you want?

(function refineQuery(current, parent) {
	current.addQuery("u_work_reference", parent.getValue("u_work_reference"));
	current.addNotNullQuery("u_work_reference");
})(current, parent);

 

CN-L
Giga Contributor

I've now scripted the relationship and when I open an existing update set, it does list all other update sets which contain the same work reference number, which is one step closer so thanks for that @lauri457  🙂

 

What I'd really like t achieve is for the list to update/refresh when adding the work reference number to a new update set (so client-side change) so that you can see all of the other update sets with the same work reference number before saving the record, as we may have multiple developers working on the same project, so it would be good to see the filtered list before saving.

CN-L
Giga Contributor

It's not the prettiest however I have found a solution... After creating the scripted sys_relationship and adding the embedded list, I've used an onSubmit Business Rule which checks to see if an update set already exists with the same work reference number and version. If so, an error message is displayed to advise, however this behaviour seems to refresh the embedded list, allowing you to see all matching update sets - then, you just need to amend the version number manually.