Jump to content

Using EVALUATE function to Auto-enter a Date


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

Recommended Posts

I have a date field which uses the Evaluate Function in the Auto-enter by calculation to update the date when a Signature is entered into a container field.

I just found out that the date is being updated with the SYNC date instead of keeping the original date that the signature was entered.

For Example: a new signature is entered in the offline file on 10/3/17, the "Date" field gets auto-entered with a date of 10/3/17.  On 10/5/17 the offline file is sync'd with the host.  Now the date on the host has been entered with 10/5/17 instead of 10/3/17.

How do I fix this so the original date gets entered and is not based on when the sync occurs?  I need to do this at the field level or Sync layout level, and not through a script trigger because I have the date field (actually 4 date fields) on over 100 layouts.

Link to comment
Share on other sites

I can't think of a very 'clean' way to do this.

One hack would be to use the MirrorSync customization script to set a $$sync_is_running global variable, and then unset it when the sync ends. Then you could modify your evaluation to trigger conditionally based on this global variable. I don't feel very confident in this approach though. The only really solid way to accomplish this is by doing it with a script trigger at the UI layer (which I understand why you don't want to do that).

If you do decide to use the customization script approach, remember to select the XML option in MirrorSync (not JDBC), because only XML uses the MirrorSync customization script on the server.

Link to comment
Share on other sites

Thanks Jesse.

Could I change the order the fields are sync'd?  If I sync the Signature field first and the Date gets updated with the SYNC Date, and then I sync the Date field, it should overwrite the SYNC date with the Signature Date?  right?

If this would work, how do I change the order the fields are sync'd?

Link to comment
Share on other sites

As far as sync order goes, primary keys are always first, followed by foreign keys, followed by regular fields, followed by any field with an auto-enter option, followed by container fields. Within each group, the order is alphabetical.

Link to comment
Share on other sites

This topic is 2386 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.