So i have a button that needs to hide when a static label entity is a certain option. SO i have this if statement: 

And even IF the Label is Afgerond, it still does not hide the button:

So what do i wrong?

Hi Samed,


You're comparing the label instead of the Id.

In OutSystems, Entites.<Static Entity>.<Record> will return the Id of the static entity record, thus you should compare Id with Id.

You should try the following:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id <> Entities.Aanvraag_Voortgang.Afgerond


Hope it helps.


Cheers,

João

Hi Samed,

You can use below check to show you button as per your requirement:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id <> Entities.Aanvraag_Voortgang.Afgerond

and in true condition put your button.

Hope this will help you

Regards,

Vipasha

So this is mine condition now:

But it is now hiding even if the condition is false. So the button only needs to hide when the label is Afgerond, otherwise you still need to see the button, now it is hiddin in any case


Hi Samed,


You are using = and you have the button on your True branch.

Can you replace the for <> ?

Like this:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id <> Entities.Aanvraag_Voortgang.Afgerond 


Cheers,

João

Hi Samed,

try this:

GetAanvraag_voortgang(GetAanvraagVoortgang.list.current.Aanvraag_Voortgang.Id).Aanvraag_voortgang.Label=Entities.Aanvraag_voortgang.Afgerond

Regards,

Samiksha


Hello @vipasha and @joao. I tried both the solutions but it does still not work. Really strange thing is, i have setup a IF condition within the button action itself. SO whenever you click the button AND the label is allready "Afgerond" it gives a warning and stops the action. And this does work, so you get a warning when the label allready is "Afgerond", but when i use the same condition to enclose/hide the button it does not work. 

Hi Samed,


Do you mean when you press the button, the status should change and therefore the button should disappear, is that it?


Because if that is the case, when you change the status, you need to update the GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id via an Assign, so the if clause can be updated.

Can you confirm when you are updating the status you are changing the above field? Something like this


Cheers,

João

João Marques wrote:

Hi Samed,


Do you mean when you press the button, the status should change and therefore the button should disappear, is that it?


Because if that is the case, when you change the status, you need to update the GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id, so the if clause can be updated.

Can you confirm when you are updating the status you are changing the above field?


Cheers,

João

 

 Hi Joao,


So the button does change the label to "Afgerond". When the button is clicked it changes the label to "Afgerond", this must be done only 1 time, and therefore the button needs to hide when it is allready clicked. Or in other words, it needs to hide when the label allready is "Afgerond". 

Hi Samed,


Ok, now I understand.

Can you confirm then that you change the status after you click like the screenshot on my comment?

Changing that will cause the recalculation of the if.


Hope it helps.


Cheers,

João

João Marques wrote:

Hi Samed,


Ok, now I understand.

Can you confirm then that you change the status after you click like the screenshot on my comment?

Changing that will cause the recalculation of the if.


Hope it helps.


Cheers,

João

 

 Yes, sorry i didn't saw the screenshot. But yes after click it changes the status of the yellow marked condition in your screenshot. And when it is changed to "Afgerond", to button needs to hide

Can you share the OML then?

This should be very simple and there should be some detail which isn't right.


Thanks.


Cheers,

João

João Marques wrote:

Can you share the OML then?

This should be very simple and there should be some detail which isn't right.


Thanks.


Cheers,

João

 

 Hello,


unfortunately I am not allowed to share the .OML file. I can send you detailed screenshots of things you want to see? thanks for your understanding,


Cheers

Can you share the if condition you have enclosing the button and the assigns you have on the click button action?

João Marques wrote:

Can you share the if condition you have enclosing the button and the assigns you have on the click button action?

 The button itself: 

The if condition: 

 

The assign in button action:



Your assign has a different variable than the one you have in the if.

On your assign add a new line GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id = Entities.Aanvraag_Voortgang.Afgerond.


That will do the trick :)


Cheers,

João

João Marques wrote:

Your assign has a different variable than the one you have in the if.

On your assign add a new line GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id = Entities.Aanvraag_Voortgang.Afgerond.


That will do the trick :)


Cheers,

João

 

 believe it or not, it still does not work :). This is the IF: 

And the button is on both true and false. But it is still vissible, even the label is changed to "Afgerond"

To make sure we are at the same page, your IF should look like this (with <>):



And when you click the button you should have an assign like this:


If you do that, it should work.


Cheers,

João

João Marques wrote:

To make sure we are at the same page, your IF should look like this (with <>):



And when you click the button you should have an assign like this:


If you do that, it should work.


Cheers,

João

 Hi Joao, 

Yes it looks exactly the same, but i guess i have to do it with just a massage like this

 because this works fine, i do not know why the other does not work

Hi,


You say it is the same, but your screenshots show something different.

Can you do the following steps and see if it works?

1. On the IF of your button, place the following condition:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id <> Entities.Aanvraag_Voortgang.Afgerond 


2. On the IF on your action, place the following condition:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id = Entities.Aanvraag_Voortgang.Afgerond

3. On your assing, place the following:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang

Entities.Aanvraag_Voortgang.Afgerond



Cheers,

João

João Marques wrote:

Hi,


You say it is the same, but your screenshots show something different.

Can you do the following steps and see if it works?

1. On the IF of your button, place the following condition:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id <> Entities.Aanvraag_Voortgang.Afgerond 


2. On the IF on your action, place the following condition:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang.Id = Entities.Aanvraag_Voortgang.Afgerond

3. On your assing, place the following:

GetAanvraagVoortgangs.List.Current.Aanvraag_Voortgang

Entities.Aanvraag_Voortgang.Afgerond



Cheers,

João

 

 This is the if condition of the button:


This is the if in the action: 


this is the assigning:

the second assigning is to save it correctly to the database

Solution

Ok, now I think I know what is going on:


1. On the IF of your button, place the following condition:

GetGegevenById.List.Current.Gegevens.Aanvraag_VoortgangId <> Entities.Aanvraag_Voortgang.Afgerond 


2. On the IF on your action, place the following condition:

GetGegevenById.List.Current.Gegevens.Aanvraag_VoortgangId = Entities.Aanvraag_Voortgang.Afgerond


Like this, the variable you are checking is the status of the record.


Can you try the above conditions and let me know how it goes?


Thanks.


Cheers,

João

Solution

João Marques wrote:

Ok, now I think I know what is going on:


1. On the IF of your button, place the following condition:

GetGegevenById.List.Current.Gegevens.Aanvraag_VoortgangId <> Entities.Aanvraag_Voortgang.Afgerond 


2. On the IF on your action, place the following condition:

GetGegevenById.List.Current.Gegevens.Aanvraag_VoortgangId = Entities.Aanvraag_Voortgang.Afgerond


Like this, the variable you are checking is the status of the record.


Can you try the above conditions and let me know how it goes?


Thanks.


Cheers,

João

 

 Hello Joao,


Thank you mate, it works fine now! Thank you for your time and effort, i appreciate it!


Cheers,

Samed

Haha, I am glad I could help :)


Cheers,

João