UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2023 06:50 AM
there are two button on incident form one is strike and second is chase out .
i want this button to work as when button would be Disabled/Enabled automatically based on Store Opening Times .
i am using this script -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2023 07:53 AM
Hi @Nafisa Zaman ,
How is this script include called?
This is not correct :
var gr = new GlideDateTime('u_apex_store_timing');
u_apex_store_timing should be parsed as a variable & it should come in the script include as parameter.
In your existing code your passing that value as a string which is wrong.GlideDateTime expects some date & time value.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2023 07:56 AM
Hi @Nafisa Zaman,
You can call this function in the condition of UI Action. UI action will visible/hide based on return value of diff from the script. What's issue there if this script is not working as expected, please share more details.
diff = 0 // both date/time are equal => return false
diff= 1 // gr datetime is after currentTime => return false
diff = -1 // gr datetime is before currentTime => return true
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution