PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WB ..modified
WB ..modified
Débuté par SolutionJ-Reg, 21 juin 2017 12:37 - 4 réponses
Posté le 21 juin 2017 - 12:37
Hi

I've just found out that the ..modified feature is not available in Webdev (at least up to v20).

Is there a comparable feature that can be used in Webdev, i.e. to be able to check if one or more data fields have been changed?

Cheers
Reg
Posté le 21 juin 2017 - 12:57
Hi Reg,

you will have to enumerate your fields, and compare their value to their original ones.

It is what I do everywhere, even if ..modified is available, because the way ..modified works does not suits me...

Did you know that if you have an empty field, if user enters 123, then deletes the 123 (os that the field is empty again), ..modified will answer true?

..modified means "the user did something in there" and not, the value is different, which is why I never use it...

Best regards
Posté le 21 juin 2017 - 13:01
Hi Fabrice,

I was aware of the limitation of ..modified but for most normal purposes it works well enough for me.

So I have to compare every data field's value to what it was? Do you mean to the underlying database table record value? What about fields that are not linked? Do you just store their original values when the page is opened?

Thanks for the help, it's very much appreciated.
Reg
Posté le 21 juin 2017 - 13:20
Hi again

of course, the exact way I do it depends of the purpose of the code.

If we are talking about knowing which fields of a record have been modified, I'm doing that in WXReplication, during the call to hmodify... At this point the file buffer was filled with everything from the fields, and I'm checking field by field against the original/current database record.

Of course, if you need to check BEFORE the hmodify (or if there is no hmodify), then you need to enumerate your field and do all the appropriate coding...

However, if you are in the first case, there is a source available for you with a full working example (my WXreplication open source system replicates only the modified fields, of course)

Best regards
Posté le 21 juin 2017 - 13:21
Ok, thanks very much for that, I now know what I'll be doing this afternoon :-)