I want to display check box checked if the condition is Isdeleted=yes and and checkbox should be unchecked if the IsDeleted=no how to do that can anyone please help.
When i try to register freshly the check box is working fine the problem is while editing the saved data. If i click on edit if the isdeleted =no or isdeleted =yes for both the condition its displaying as unchecked.
Hi Shalini,
Can you please tell in which type of app (Web, Reactive or Mobile) you are working on?
If it is mobile you can check in OnAfterFetch of the aggregate.
Then assign the values to the variable.
Reactive
Hi,
Why do you use the values yes and no? Why didn't you make the attribute's data type a Boolean which has two possible values, True and False.
If you bind an attribute of type Boolean to the checkbox Variable attribute, it automatically is checked if the boolean is True and unchecked if the boolean is false.
Regards,
Daniel
Hi Shalini D M,
Using a Boolean attribute directly for the checkbox is indeed a more straightforward and cleaner approach.
Here's how you can set it up:
With this setup, the checkbox will automatically be checked if the Boolean attribute is True and unchecked if it's False. This simplifies the logic and ensures a more natural representation of the "IsDeleted" state.
Regards
Reemali.
No i can't change the data type of Isdeleted to boolean
It is mandatory to set it as yes or no (Y or N)
Doesn't make sense to me, a Y/N True/False value is as best practise stored as a boolean.
In that case you can in the OnAfterFetch event of the aggregate return an output parameter of data type boolean, based on the Y or N and use it to set the checkbox value.
As per your request, I have added few logic. Check out my page: Checkbox
I have attached the oml as well. Please let me know if you need any assistance.
Thanks.
here the doc:
https://success.outsystems.com/documentation/11/reference/outsystems_language/interfaces/designing_screens/checkbox/
may this helps
Hi @Shalini D M,
I am attaching an OML. please refer this.
Sample - sample
Hope this will help
Thanks
Prince
Create one local variable or if you have any attribute in the entity that is bind to that checkbox after that when the condition is isdeleted =no or isdeleted =yes just change the value of variable.
Hope this helps!
hello @Shalini D M ,
**If you are using aggregate then Please follow below
In aggregate add new attribute with Boolean data type and add expression in value of attribute as if(entity column value="Yes",true,false)
So this will return true false in result of aggregate and you may bind this variable to checkbox directly.
**If you are using data action then follow below
add one attribute in your structure which are using named as IsChecked.Do looping on result of dataaction and inside loop you may add if condition like if(dataaction.list.current.isdeleted="Yes",true,false) and inside true mark your ischecked as true or false.
Hope this willl help you.
Honestly, I don't understand why this discussion keeps going.
Multiple solutions have been provided in this discussion. This whole discussion is foremost this long, as it was chosen to store a boolean value in a text attribute.
As I mentioned in my first reply in this discussion, that is a bad decision, that not only impacts the ease on how you can set/get the value from a checkbox, but in all places in logic that requires code, like in an IF rather than checking on True or False which will automatically be validated by TrueChange you need to check by 'Y' and 'N', string literals where you can make a typing mistake that will not be indentified by TrueChange.