Hi Stephane,
Thinking in ”old-school” 4D code, using a trigger can be a good way to enforce 
a field population rule but an alternative is to create the date field’s object 
method and populate the integer from there. The code may well be easier to find 
and maintain from there.
If you need help to do the actual conversion (and ‘de-conversion’ if that’s a 
word) I’m sure you’ll get plenty of suggestions if you ask.
HTH, Keith

> Date: Sun, 7 Aug 2022 22:51:20 -0400
> From: Stephane Potvin <[email protected]>
> To: 4D iNug Technical <[email protected]>
> Subject: How to convert date to integer or vice versa
> 
> I have two fields in a table which must contain the same information.
> One is date, the other an integer.
> Rather than entering the same information twice, I would like to enter it in 
> one field and have 4d fill the other field automatically.
> Can you help with the proper method to do so.
> Thank you.
> 
> ------------------------------
> Date: Mon, 8 Aug 2022 02:59:27 +0000
> From: Keisuke Miyako <[email protected]>
> To: 4D iNug Technical <[email protected]>
> Subject: Re: How to convert date to integer or vice versa
> 
> triggers!
> 
> https://doc.4d.com/4Dv19R5/4D/19-R5/Triggers.300-5831495.en.html
> 
> Can you help with the proper method to do so.
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to