P10 Mobile - Aggregate in function

P10 Mobile - Aggregate in function

  

Hello.

Why isn't it possible to have Aggregates in Client Functions? Am I missing some step here?

Thanks in advance.

Hi Helder,

Functions are supposed to be fast and simple actions that return a result immediately (synchronously).

Aggregates are asynchronous tasks (don't return results immediately)  and thus cannot be used inside functions.

Hope I didn't get too technical.

Thanks for your answer João.

Are aggregates to local storage asynchronous too?

I'm using the local storage to save the current logged user permissions. Inside the same screens some content depend on the type of permission and therefore I can't just use the platform ones. I was trying to check the user's permissions on the screen trough a function. Since I can't do that, I have to run the actions on 'OnInitialize' and assign the results to local variables. (a mess) There's got to be a better way, right?

Yes, aggregates are async too.

I think that the best approach.