Home > Forum > Rules, JS, SQL > Retrieving previous and comparing to new value

Retrieving previous and comparing to new value
0

Hi, I'm having a dilemma about comparing two date objects. My thinking is when I do sql queries to retrieve data from objects it will give you already stored db results, but with webcon functions you actually get value before it is actually stored. It does not work this way, so i'm looking for a way to do it. In conclusion, it should compare date before change and after change (this is triggered on menu action SAVE).

In reply to: Daniel Krüger (Cosmo Consult)

Hi,

you could check out this blog post:
https://daniels-notes.de/posts/2023/has-field-value-changed

I've no idea whether it's still working with the latest version.

Best regards,
Daniel

Unfortunately it's not working. I have a bit different example where I'm retrieving date from a data table so history db will be different(WfHistoryElementDetails) so I modified it. In the end, it did not work. Is only solution via sql ? Is there a solution more 'native' to webcon ?

MVP
In reply to: Arthuzad

Unfortunately it's not working. I have a bit different example where I'm retrieving date from a data table so history db will be different(WfHistoryElementDetails) so I modified it. In the end, it did not work. Is only solution via sql ? Is there a solution more 'native' to webcon ?

Hi,

as you noticed, there's no build in function to access a previous value.
An alternative would be to store the current value in a technical field. You could do this on form load / using the behavior tab or with an action, after the check has been executed.



Best regards,
Daniel

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings