Unfetched attribute access error

I am trying to make the calendar only show meetings that are relevant to to user who is currently logged into the application. but i have encountered some problems.
one of them include the following:
Every time i try and execute the code below it doesn’t allow me to login to the application.

showNotification(p.getName().toString());

public://attachments/f8531e3e33ffba72297b19f90e3cffb0.PNG

f8531e3e33ffba72297b19f90e3cffb0

hi,

you did not attach anything. Can you please share the app.log file from studio, this will reveal the underlying problem…

Bye

Unfetched attribute error happens especially when you are calling a field that is not in your view.

hi,

Here is the app.log file…

thanks

app.log (290.7K)

Hi,
You have not attached the project.
There are two appropriate ways to share the project:

  1. Zip it using the zipProject Gradle task. Then you can share the archive here.
  2. Public the project on GitHub and share the link to it.
    In your app.log I see that your application uses external LDAP authentication and the Admin user could not authenticate. Is there the “Admin” entry (with the corresponding password) in your LDAP(Active directory) system?
    Regarding the showNotification(p.getName().toString());. Could you share the whole source where the code is called?

Hey,
I replicated my the in my project that is giving me the error.
I created a Entity called “Participant” as shown in Figure 1. This entity only has 1 attribute called user and it is an association of type “User[sec$User]”.
This attribute has one view (as Shown in Figure 2).
My project 4 screens in total (as shown in figure 3).
I have 1 service called TestService(as shown in figure 4), where i have method that gets all the users in the participant table, puts it into a list of type “Participants” and returns it (as shown in figure 5).
In figure 6 (the controller of the mainWindow), i that code to print out the login name of the users in the list that i have created in the service…
but every time i use the following code:

showNotification(p.getUser().getLogin());

it prevents me from logging into the application ( as shown in Figure 7).

Please help
Regards,

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Hi,
Assumably, the problem is that the service returns Participants with the “_local” view. To get fields of the related User you should reload Participant. The following code should work well in your screen controller.

Participant p = dataManager.reload(participant.get(i), "parcicipant-view");
showNotification(p.getUser().getLogin());

Regards.

Hi,

That worked for me thank you.

Regards,