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.



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.

Solution

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

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!

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!