loading after Login (reactive web)

Hi, 

I Have a query with a Filter that show me the registers saved by my username. They show me in page well done if im already Logged, or if I navigate from pages. but if I do my login They show all registers, after I refresh the page or navigate on pages they list only the registers with the filter. 

I need to refresh Data automatically after Login, I try do a Action Refresh Data on the EVENT "On Initialize", "On Ready", "On Render" and nothing. I search but someone tell to Create Action "On After Fetch" but I dont know How to do That. 


Any Help please.

Hi Viktor,

Unless you have reports without an associated name, it is not possible you get all registers if you're not logged in. I assume that "Client.Username" contains the name of the logged in user? If that is empty (which I assume it is when not logged in), you filter on only empty Formulario.UserReporte. If that yields records, I suppose you have something wrong with your data.

I also find it strange someone can look at the data without being logged in. Typically, you set at least the "Registered" Role on the Screen, so that when you're not logged in, you have to log in first.

You should not refresh data in the On Initialize, On Ready or On Render. The data is possibly still busy being fetched at that moment, and you don't want to trigger a refresh!

On After Fetch is something you use if you want to do something after the data has been fetched (what's in a name...), so that won't help you here either.

tl;dr: you should always have a logged in user, and your problem won't exist.

Hi Viktor,

You can use directly in aggregate filter condition


SyntaxEditor Code Snippet

Formulario.UserReport=GetUser(GetUserId()).User.Username


after data fatch you can create action like below image-

go to "On After Fetch" and select an action or can create new .


Regards

Rahul Sahu

Kilian Hekhuis wrote:

Hi Viktor,

Unless you have reports without an associated name, it is not possible you get all registers if you're not logged in. I assume that "Client.Username" contains the name of the logged in user? If that is empty (which I assume it is when not logged in), you filter on only empty Formulario.UserReporte. If that yields records, I suppose you have something wrong with your data.

I also find it strange someone can look at the data without being logged in. Typically, you set at least the "Registered" Role on the Screen, so that when you're not logged in, you have to log in first.

You should not refresh data in the On Initialize, On Ready or On Render. The data is possibly still busy being fetched at that moment, and you don't want to trigger a refresh!

On After Fetch is something you use if you want to do something after the data has been fetched (what's in a name...), so that won't help you here either.

tl;dr: you should always have a logged in user, and your problem won't exist.

Killian, The user is Logged in this case. Example If I do the Login, Im sended to the main page (that Have the Filter), but the filter its not executed, and if I go to another Page and come back to main page ou do Refresh (F5) the filter its Executed.

I need make refresh my agregate with filter in the load of my main page.

Rahul Sahu wrote:

Hi Viktor,

You can use directly in aggregate filter condition


SyntaxEditor Code Snippet

Formulario.UserReport=GetUser(GetUserId()).User.Username


after data fatch you can create action like below image-

go to "On After Fetch" and select an action or can create new .


Regards

Rahul Sahu

Rahul, 

this Filter dont show nothing unfortunately.

About "On After fetch" On reactive web dont have this event.

the reason to come to anyone explain me.

 


Hi Viktor,

You say "the filter is not executed", but that is simply not possible. If you do not get the result you envision, there's either a bug, or your expectations are wrong. Most likely, the variables that are used in the Filter aren't initialized yet, which explains the wrong outcome.

Also, "On After Fetch" is available exclusively for Reactive (and Mobile), so I'm not sure why you think it isn't.

I think at this point it is easiest if you can share a Module that shows what you are trying, so that we can take a look where the problem is.

Kilian Hekhuis wrote:

Hi Viktor,

You say "the filter is not executed", but that is simply not possible. If you do not get the result you envision, there's either a bug, or your expectations are wrong. Most likely, the variables that are used in the Filter aren't initialized yet, which explains the wrong outcome.

Also, "On After Fetch" is available exclusively for Reactive (and Mobile), so I'm not sure why you think it isn't.

I think at this point it is easiest if you can share a Module that shows what you are trying, so that we can take a look where the problem is.

thanks For the Help I surpass already this issue.

I rebuid my filter, before I use Client.username = Formulario.UserReporte, because Client.Username its the Name of my user Logged, but I had The error, Now I put The Funcion User_GetName(), Its show exactly the same, and execute the filter after my login.