Calc Fields
GoZync4.CalcFields History
Show minor edits - Show changes to markup
The key is to have a calc on only one side (either mobile or hosted) and that the field only needs to be on the layout you pull from: so put the calc version on the sync layout--we'll pick it up and send it on it's way. If you put the corresponding non-calc version on ITS sync layout, we'll try and send it on its way, and there will be a calc at the other end causing an error. Remember, the only fields you need on a sync layout are the fields you're sending from that layout.
Yes, though you can't sync "into" calc fields. For example, you can have a calculated field in the host that you pull into a regular fields on Mobile. Or you can have a calc'ed field in mobile you push up to a regular field in the host.
But if you have calc fields of the same name in both your hosted and mobile tables, you'll see errors when you check your work in GoZyncHosted and you'll get errors that stop your sync.
For more on calc, setting literal values, and conditionally setting fields, read up on Custom Field Mapping.
Yes, though you can't sync "into" calc fields. For example, you can have a calculated field in the host that you pull into a regular field on Mobile. Or you can have a calc'ed field in mobile you push up to a regular field in the host.
But if you have calc fields of the same name in both your hosted and mobile tables, you'll see errors when you check your work in GoZyncHosted and you'll get errors that stop your sync: because you can't set values into a calc field, of course.
For more on calcs, setting literal values, and conditionally setting fields, read up on Custom Field Mapping.
Yes, after a simple modification.
By default GoZync will skip any calc, global, or summary fields on your sync layouts. (You should still remove them from your layouts as that will speed up the sync.)
But there may be times when you want to sync a calc field, pulling it down from the server and placing it into a non-calc field on the mobile side. (You can't set it into another calc field, obviously, as trying to set calc fields throws errors in FileMaker.) This could be useful, for example, when you want to bring down a contact's credit limit, but that limit is stored in a related table: rather than sync the related table, you could create an unstored calc for this value in the contact's record in your hosted file, and then sync that down to a regular field in the contact's record in your mobile file.
To enable this you need to turn off GoZync's skipping of calc fields. This very easy.
Edit the script "Get Fields { FileName } (LayoutName; LayoutTableName)" in GoZyncHosted and find the line shown in blue below. Remove the "or test" for calc fields. That's it.
http://www.seedcode.com/rootimages/stikipad/gozync/calc2.png
If you need to push a calc field, you'd edit a similar script in GoZyncMobile:
http://www.seedcode.com/rootimages/stikipad/gozync/calc1.png
Note, GoZync will try to match the field names between the hosted and local tables, so if your cal and regular fields don't have the same name (like one is z_CreditLimitCalc and the other CreditLimit) you'll want to use transformations? to link the two field names.
And remember, in our example above, you won't want the local version of that credit limit on your sync layout on the local side: that would push it back to hosted where setting it into its calc counterpart would fail. =)
Yes, though you can't sync "into" calc fields. For example, you can have a calculated field in the host that you pull into a regular fields on Mobile. Or you can have a calc'ed field in mobile you push up to a regular field in the host.
But if you have calc fields of the same name in both your hosted and mobile tables, you'll see errors when you check your work in GoZyncHosted and you'll get errors that stop your sync.
For more on calc, setting literal values, and conditionally setting fields, read up on Custom Field Mapping.
And remember, in our example above, you won't want the local version of that credit limit on your sync layout on the local side: that would push it back to hosted where setting it into it's calc counterpart would fail. =)
And remember, in our example above, you won't want the local version of that credit limit on your sync layout on the local side: that would push it back to hosted where setting it into its calc counterpart would fail. =)
Note, GoZync will try to match the field names between the hosted and local tables, so if your cal and regular fields don't have the same name (like one is z_CreditLimitCalc and the other CreditLimit) you'll want to use transformations? to link the two field names.
Note, GoZync will try to match the field names between the hosted and local tables, so if your cal and regular fields don't have the same name (like one is z_CreditLimitCalc and the other CreditLimit) you'll want to use transformations? to link the two field names.
And remember, in our example above, you won't want the local version of that credit limit on your sync layout on the local side: that would push it back to hosted where setting it into it's calc counterpart would fail. =)
Note, GoZync will try to match the field names between the hosted and local tables, so if your cal and regular fields don't have the same name (like one is z_CreditLimitCalc and the other CreditLimit)
Note, GoZync will try to match the field names between the hosted and local tables, so if your cal and regular fields don't have the same name (like one is z_CreditLimitCalc and the other CreditLimit) you'll want to use transformations? to link the two field names.
Can GoZync Sync Calc Fields?
By default GoZync will skip any calc, global, or summary fields on your sync layouts. (You should still remove them from your layouts as that will speed up the sync.)
But there may be times when you want to sync a calc field, pulling it down from the server and placing it into a non-calc field on the mobile side. (You can't set it into another calc field, obviously, as trying to set calc fields throws errors in FileMaker.) This could be useful, for example, when you want to bring down a contact's credit limit, but that limit is stored in a related table: rather than sync the related table, you could create an unstored calc for this value in the contact's record in your hosted file, and then sync that down to a regular field in the contact's record in your mobile file.
To enable this you need to turn off GoZync's skipping of calc fields. This very easy.
Edit the script "Get Fields { FileName } (LayoutName; LayoutTableName)" in GoZyncHosted and find the line shown in blue below. Remove the "or test" for calc fields. That's it.
http://www.seedcode.com/rootimages/stikipad/gozync/calc2.png
If you need to push a calc field, you'd edit a similar script in GoZyncMobile:
http://www.seedcode.com/rootimages/stikipad/gozync/calc1.png
Note, GoZync will try to match the field names between the hosted and local tables, so if your cal and regular fields don't have the same name (like one is z_CreditLimitCalc and the other CreditLimit)