0

I have Cases, which have many Users assigned to them, and Users can belong to many Cases. This association is stored in a custom joining object called a UserAssignment.

I'm trying to find an out-of-the-box way to display all of the current user's cases using this join table. I'm able to write the SOQL to produce the join results I want, but I'm trying to build a standard list or related list view.

The UserAssignment object has a formula field, IsMyAssignment, with the value $User.Id = Assigned_User__c, which returns true so I already have a way to find UserAssignments for the current user.

I've tried a few things, but I'm hitting roadblocks:

Attempt 1: Making a standard record list view of UserAssignments

Using the standard record list view page of UserAssignments, I added a filter for IsMyAssignment equals True, which shows me the list of all the UserAssignemnts, but the problem is I can't add any fields of the case, which are required to show in this list. I can only add the Case ID.

Attempt 2: Making a related list view for the User object

If I could show a related list for a User, maybe I could show their assigned cases? But apparently this is impossible.

Attempt 3: Using a roll-up field on the Case to count UserAssignments

I made a roll-up field on the Case to attempt to count the number of UserAssignments where IsMyAssignment equals $User.Id, but this doesn't work because you can't use interpolated values like $User.Id in rollup fields apparently, nor can you use formula fields like IsMyAssignment.

0

Since the junction object itself must contain the relationship fields to the related objects, one thing you could do is add formula fields to pull in data from the related object(s).

It's a bit of a pain because you'll need to make two modifications to get any changes displayed in a related list (add a new formula field to the junction object, modify your related list to include this new field), but the advantage is that it only requires OOTB functionality.

After looking into it a bit, it appears that the tricky part would be displaying this to your users. Your attempt #1, listview on your junction object, seems to be the most feasible approach.

0

Attemp 1 is the most feasible approach. If you need to show the case information on UserAssignment List View the create the required formula field and add it on list view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.