Auto-enter on import is an all or nothing option. Either all auto-enter field options are triggered on import or none of them.
In your situation, you can use Replace Field Contents to perform the same computation on this field immediately after the import. THis can be done manually or as part of your import script. (Replace Field Contents changes all the records in your found set. Immediately after import, your found set will be all the newly imported/updated records.)
For some reason, when I use Replace Field Contents, I get a ? for the result of my calculation. My elapsed calculation is as follows:
Let ([ Record_Number = Get ( RecordNumber ) - 1]; ((Database::Date - GetNthRecord ( Database::Date ; Record_Number)) * 86400) + Database::Time - GetNthRecord ( Database::Time ; Record_Number) )
Some things I have tried to remedy:
Tried instead of Replace with "current contents" Replace with calculation "Time + 1"
Tried placing the Replace with "current contents" function inside of a second script and had the first script run that at the end.
Tried putting more functions in between the Import and Replace functions.
However, one thing that does work is if I Show All Records before running the Replace function but then this replaces the Time of every single record in my databse so I can't have that... but it does trigger the calculaton... which basically makes all the Elapsed times 00:00. Kind of odd. Hopefully you have a clue.
Thanks for your help.
The problem is that you getnthRecord calcualtion fails for the first record and then you get ? for it and all subsequent records.
GetNthRecord refers to the record immediately before it in the current found set as controlled by any sort order specified for it. (No sort order, they'll be in order created. or imported in this case.)
Are all imported records to appear after all previous records?
If so, you can go to the oldest existing record to capture the values needed from those fields in variables before you perform the Import records step and then include them in your replace fields calculation. (If it's not all one script, use global variables.)
Let ([ Record_Number = Get ( RecordNumber ) - 1;
Prior_date = If ( Record_Number ; GetNthRecord ( Database::Date ; Record_Number) ; $PriorDate ) ;
Prior_time = If ( Record_Number ; GetNthRecord ( Database::Time ; Record_Number) ; $PriorTime )
(Database::Date - Prior_date ) * 86400 + Database::Time - Prior_time
Now my calculation came out really weird. I'll try looking more into it later my brain hurts now. Unless maybe you know off the top of your head what is wrong.
How did your script capture the values for $PriorDate and $PriorTime?