on 05-01-2020 12:52 PM
Hi
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:
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:
P.S:
I did attempt the approaches mentioned in https://blogs.sap.com/2019/08/21/computed-field-example-in-cap/.
I found that dj.adams.sap 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
(see: https://github.com/scongia/or-assistant/commit/cfa0e096e52b98a3a380140df8fa6d2014d50657).
I then tried pdominique-bio 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
(see: https://github.com/scongia/or-assistant/commit/994cb183d29c1bb6c3a03423c7599383056733dc)
As mentioned. I managed to get the Role Name to appear by adding a Promise.all to the handler as shown above.
What I observed though is that the when adding a new field in the Service layer, this causes an SQL error creating new records using oData v2, however there is not error when using oData v4
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.