Jump to content
SarahS

Auto-enter Calculation Behavior Differences

Recommended Posts

I just updated all the IDs in my solution to use UUIDs due to issues I was having with duplicate IDs.  I am confused about how auto-enter calculations (that replace existing values) work with MirrorSync.

My question:

How is the value in a field with an auto-enter calculation (that replaces an existing value) different when the field is specified as the primary key field in the MirrorSync configuration versus when it is not?  Does the value get changed during synchronization depending on if a global field is referenced?  Does having the option to evaluate the field even if the referenced fields are empty also create a difference in behavior?  

Thank you very much for helping clarify this!!!

This is how I used to be creating the IDs and have now abandoned for the UUID method:

serialNumber (number) field: number field that auto-enters a serial number - the value of this field gets reset in each table by script using "GetNextSerialValue" each time a user logins and their device prefix is identified

ID (text) field: auto-enter calculation (replaces existing value) that combined the device prefix (stored in a global field) & the record serialNumber - this field was used as at the primary key as well as the user-visible record number

devicePrefix (text) field: auto-enter calculation (replaces existing value) of the left two characters of the ID field

This is how I am now setting the UUID & user-visible IDs:

no changes to field def. - serialNumber (number) field: number field that auto-enters a serial number with modifications prohibited - the value of this field gets reset in each table by script using "GetNextSerialValue" each time a user logins and their device prefix is identified

new field - ID_OLD (text) field: auto-enter calculation (replaces existing value) that combines the device prefix (stored in a global field) & the record serialNumber - this field was set with the existing IDs prior to converting to UUIDs and is used as the user-visible ID

changed field def. - ID (text) field: auto-enter calculation (replaces existing value) of Get(UUID) - this field is still the primary key field

changed field def. to reference the ID_OLD field vs. the ID field - devicePrefix (text) field: auto-enter calculation (replaces existing value) of the left two characters of the ID_OLD field

Share this post


Link to post
Share on other sites

Since making my original post, I have changed the new ID_OLD field and the devicePrefix fields to have auto-enter calculations from the (same) device prefix global field, but they do not replace existing values.  There are only a few scripts in my solution that duplicate records, so I am manually resetting the fields by script when a new record is created by duplication.  This seems to be working but doesn't seem like the best solution....

Share this post


Link to post
Share on other sites

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

×

Important Information

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