Skip to Content
May 01, 2020 at 11:52 AM

Referencing a field from a foreign entity in an ObjectPage table



Can anyone offer an approach to this.

I am working on a use case for maintaining people using business partner design. In this design a person can take on one of more roles. Below is a diagram of the normalised data model I have created thus far which seems to be working to a point.

I have been able to do the following without having to maintain a service.js file. I.e. the CDS engine supports all crud operations out of the box (which is pretty impressive work from the CDS team). Until now I can:

  • create a Person,
  • store the draft version of Persons and Person_Role
  • create a new role (while in edit mode),
  • use the search help to search for a Person_Role.ID value where the search-help is referencing the Role entityset

To make the ObjectPage more meaningful to a user, I would like to add a column for Role Name that will show the corresponding name (Role.roleName) for the selected Role ID.

Is there a way to do this while maintaining a normalised data model?

Thanks in advance:


I did attempt the approaches mentioned in

I found that DJ Adams approach resulted in an "SQLITE_ERROR: no such column: roleName" when creating a new Person_Role - Possibly requiring some intervention to remove the computed roleName field and then create the insert manually


I then tried Pierre Dominique approach but this resulted in a compile error on AdminService saying "AdminService.Person_Role" of autoexposed entity for "com.or.assistant.Person_Role" collides with other definition - possibly because to Persons has a @odata.draft.enabled annotation