- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2024 11:25 PM
I have created a settings page using UI builder. In that page I have a toggle and if the toggle is enabled then I want to trigger a scheduled job.
How we can check whether the toggle is enabled/disabled?
Thanks
Ajay
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 07:46 AM
One way to do this is to:
1. set up a boolean state variable such as toggleState
2. Bind the checked property to your state variable
3. Update the state variable when the toggle changes
4. you can then access the state variable later such as in this script I wrote when a button is clicked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 07:46 AM
One way to do this is to:
1. set up a boolean state variable such as toggleState
2. Bind the checked property to your state variable
3. Update the state variable when the toggle changes
4. you can then access the state variable later such as in this script I wrote when a button is clicked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 11:56 PM
@Kevin83 Thanks for the reply
I followed the steps but in the log it is always showing as false.
Can you please confirm if its giving correct value at your end.
Thanks,
Ajay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2024 07:01 AM
Yes I checked it on my end and it is logging the value correctly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 08:07 AM
@Kevin83 Below is the configuration which I have done, The only difference is that I want to trigger the toggle not with the button, the toggle on/off should be triggered by the toggle itself. Below are the screenshots:
The value is not changing when toggle is changed to on/off.