Jump to content

This topic is 8328 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a date field that I am using to determine how recently a record has be exported, if at all. Now I am being asked to have the record flagged to be re-exported every time it is modified (without initiating a script). Is there a way of clearing a date every time the record is modified? Am I lame for not seeing it? Anyone?

-Heather

Posted

The tricky bit here is that modifying any non-global field in the record will change the modification date/time of the record.

As part of the export routine, set g_export_date and g_export_time GLOBAL fields to record the export date and time for the records which were exported. Set a "Has been exported" text field as "Yes". "Has been exported" should be set to auto enter "No" on creation of a record.

You already have, I assume, modification_date and modification_time fields in your file.

Now, create another text field called "Needs_to_be_Exported" so that:

code:


Needs_to_be_Exported = if(Has been exported = "No" or modification_date > export_date , "Yes",

if(modification_time > export_time and modification_date = export_date , "Yes",""))

Execute a Find for "Yes" in the "Needs_to_be_Exported" field to show records which need to be re-exported.

This should do it. BTW, if your are trying to clear a date field, best set a field as Date("","","") otherwise you won't get a totally clear field.

Now, for the script you actually use to export the records...

Find the "Yes" in Needs_to_be_Exported

Replace All [Has been exported,"Yes"]

Export...

Pause["00:00:02"]

SetField[g_Export_Date, Status(CurrentDate)]

SetField[g_Export_Time, Status(CurrentTime)]

The order of these steps is very important, otherwise you run the risk of the modification caused by the replace step happening at the same time as the set field steps - whcih could casue the records to be re-flagged for re-exporting. The pause step makes it safer. I have put it after the export routine in case your exporting procedure changes any of the fields in the records.

Gee - this has got long and the issue of global fields in a multi user environment hasn't been solved... Will send you a file. There must be a simpler way.

Russ

[ April 15, 2002, 11:22 PM: Message edited by: Russell Baker ]

This topic is 8328 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.