Using a CheckRole
Question
Hello I'm new here in the outsystems world, i would like to know how to send the return checkadmrole.Hasrole to a local variable.

I would like to use this to enable or disable two buttons depending on the user's level.



mvp_badge
MVP
Solution

Hi Kleber,

In your preparation, drag and drop the rule, and set the retunt to variable local, example:

After, put this variable in your botton (option Enabled), example:


Regards.

Agno Silveira wrote:

Hi Kleber,

In your preparation, drag and drop the rule, and set the retunt to variable local, example:

After, put this variable in your botton (option Enabled), example:


Regards.


Perfect!!!!!! it worked exactly as I wanted!
mvp_badge
MVP

Kleber Quilez wrote:

Agno Silveira wrote:

Hi Kleber,

In your preparation, drag and drop the rule, and set the retunt to variable local, example:

After, put this variable in your botton (option Enabled), example:


Regards.


Perfect!!!!!! it worked exactly as I wanted!

 

 Cool, good that it worked.

Cheers! 

In the preparation of your screen(Where you want to enable or disable the button), add assignment  and  assign your local variable with HasRole property value.

Kleber,


The previous answers will help you achieve what you are looking for. However, I would like to add some more information. 


You can pass the output to a local variable, but also you can use the function directly as displayed in the following images:


1) If you do a double click in the Enabled property, you can reach the editor  and you have the information displayed above.


2) In that property use the function to check a specific role. 



3) Like this one


Best Regards,


João Delgado

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.