Posted: 9 May 2017 15:35 EDT Last activity: 24 May 2017 13:04 EDT
Modal based on date difference?
Is there a good way to get a modal to display if a date is 30 days before today's date?
Initially, as an action set on an onChange, I tried adding a data transform that calculates the difference between the entered date and today's date and using that fill a boolean property that would be checked as a when condition for a local action. Ran the tracer and saw that the when condition was being evaluated and the boolean was being calculated but it wasn't being checked. Then, I just used a when condition on the local action and added a declare expression on the boolean in question. Still nothing - the when condition would be evaluated but not checked.
Short of writing a custom control or a jQuery script running on change, I'm not sure where else to go with this. Any ideas?
***Edited by Moderator, Maryrita: moved to Product Support from Applications***
How and where is the local action for modal-dialog configured??
Ideally, if you're configuring a local-action in an onClick action-set, it works!
And if you've to render the modal-dialog based on a condition( today's date no less than 30 days plus a given date), it still works. But for OnClick on a button if you configure modal-dialog, then there's no way you could specify a "when" condition in that case.
"When" conditions for an action are visible or can be configured based on a condition(pzHideConditions && parent.pyIsInherited != true && parent.pyUIElement != 'layout').
If you could see a "when" condition for your event-action and if that won't work then it could be a BUG in that specific Pega version.
Custom control and an event "onchange" on it works, but it's not a best practise.
Ended up running a .js script onChange that calculates the date difference and sends an alert if the difference is greater than 30.
There are some Pega-related issues that prevent the local action to run- namely, that there would have to be a data transform that would set the number of days prior property, and this property would have to be checked. This sounds pretty straightforward, but Pega doesn't run the action sets in sequence, so the property was being checked by the when condition before it was set.