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

Privacy overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.


To see a full list of the cookies we use and learn more about their purposes, visit our Privacy Policy.