Best strategy for creating complex view forms

Hi Radzen,

I need to create a view form that shows a lot of related information to a record.

For example, a [Student Attendance] record is related to a [Student Class] record which is related to a [Class] and a [Term]. The [Class] is related to a [Course] which is related to a [Department]… you get the picture.

Suppose I want a View Form for the [Student Attendance] (not sure why I would want that, but that’s an illustration) that shows all the details of a particular [Student Attendance] record:

  • Attendance.DateTime
  • Attendance.Class.Course.Name
  • Attendance.Class.Course.Department.Name
  • Attendance.Term.Name
  • etc…

Using a Form with Disabled fields is not a good option because the inheritance chain is too long.

What would be your advice for such a scenario?

Thanks

Hi
You could create a View with all this information on

I would do it like this:

  1. Get the desired entity and $expand all related entities as needed. For example:
  2. Add a few Row and Column components to define some structure and use Label componentss to display the data. Set the Text property of the labels to ${product.ProductName} or ${product.Category.CategoryName}.

After that things should look like this:

Would something like this work for your case?

I was mentally stuck on using getRecordByRecordID when populating a form… Your solution is straightforward, thanks!

To be honest using getRecordByRecordID should have worked too if it had the $expand parameter exposed. I am logging that in the TODO list.

This would be a nice little improvement… It’s got my vote :yum:

Any news on exposing the $expand parameter in getRecordByRecordID?

Hi @semafox,

We will do our best to provide it soon, in the meantime you can use getRecordsXXX with $filter by id and $expand to return collection of one record.

Best Regards,
Vladimir

Hey @semafox,

Radzen 2.11.0 was just released with $expand query parameter support added for getByXXX, updateXXX and createXXX methods.

Best Regards,
Vladimir