Hello Community!
I'm trying to build an event inscription management app.
It all starts in CDS with 3 different entities: Events, Inscriptions and Users.
Event contains data for the event, location, date, name of event, etc.
Inscription contains data such as the inscription number, days of presence, manager approval, etc.
User contains a bit more personal data such as the user's name, email, allergies, restriction, location and other personal info.
Those entities are related this way: Event -(one to many)- Inscriptions -(many to one)- Users
Thus, I have 2 lookup fields in Inscriptions, one that picks an event and another that picks a user's name (In my case called Participant).
When creating or modifying an user profile via a form (Users entity), the name and email address fields are pumped from the AD via the User().Fullname and User().Email functions under Default in a text field and the display mode is set on Displaymode.view. No problem here!
Now, When comes the time to re-do the same with the user's name (lookup field now), under Default I replace ThisItem.Participant (contains the user's name in my case) with User().Fullname , I get an error (see image). So how do I solve this problem without messing my entities' relationships? Is there a workaround?
The whole purpose of this is to make sure that an user cant only submit an inscription for himself and no other user.
Many thanks!