Sorting by Related Data Type in a Relationship Field

I have a database structure that looks like this:

Warranty Claim

  • Consists of warranty detail fields
  • Customer field with a relationship to the Customer data type

Customer

When displaying the Warranty Claim data in a table element, how can I make the Customer Name column sort-able? The Customer Name information is stored in the Customer data type, and I can’t select it in the “sort by” drop-down.

I dont think its possible to sort by reference data. We have come a hack.

Let me think :thinking:

There may be a plugin that can do this but otherwise it requires a workaround.

They way I approach this is:

  1. create a separate text field in your data type to capture the customer name (t_Customer)

  2. Ensure t_Customer gets updated in your workflows for new and updated warranty claims

  3. Update your RG sort by to use t_Customer (you could make this a dynamic sort field using custom states)

  4. Add a backend workflow database trigger so that t_Customer gets updated if the customer name changes.