Syncing Separated Systems

Help, Tips, and Tricks for deploying GoZync: our "sync" engine for FileMaker Go.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Thu Jan 03, 2013 7:11 pm
GoZync syncs separated solutions just great and usually folks will put the sync layouts in the data file. But you can put sync layouts in the interface file, provided you modify a couple scripts...

In GoZyncMobile, find the script "Cache Fields On Layouts (LayoutName; LayoutTableName)". After the first three If() statements you'll see a line where we set the variable $FileName. Replace that line with the two lines shown in blue below:

filenamescript.png
filenamescript.png (52.49 KiB) Viewed 8208 times


The second line you can probably read, but the calc for the first one can be copied from here:

Code: Select all
// ------------  BEGIN EXECUTESQL BLOCK ------------ 

Let ( [

ReturnSub = "\n" ; // We need to swap out carriage returns in your results with a different character, so specify the character here.  \n is the default.
SQLResult = ExecuteSQL (

// ------------  BEGIN QUERY ------------

"SELECT a.\"FileName\"
FROM \"TableOccurrences\" a
WHERE a.\"ExternalFileLayoutName\" = ?" ;

// ------------  END QUERY ------ ------

"    " ; "|*|" ;

// ------------  BEGIN ARGUMENTS ------------ 

$LayoutName

// ------------  END ARGUMENTS ------------ 

 ) ] ;

// ------------  BEGIN CARIAGE RETURN SUBSTITUTIONS ------------ 

 Substitute ( SQLResult ; [ ¶ ; ReturnSub ] ; [ "|*|" ; ¶ ]  )

// ------------  END CARIAGE RETURN SUBSTITUTIONS ------------ 

)


In GoZyncHosted, the idea is the same but the script and calc are slightly different. Find the script "Get Fields { FileName } (LayoutName; LayoutTableName)". After the first three If() statements you'll again see a line where we set the variable $FileName. Replace that line with the same two lines shown in blue above, but for the first line's calc, use this:

Code: Select all
// ------------  BEGIN EXECUTESQL BLOCK ------------ 

Let ( [

ReturnSub = "\n" ; // We need to swap out carriage returns in your results with a different character, so specify the character here.  \n is the default.
SQLResult = ExecuteSQL (

// ------------  BEGIN QUERY ------------

"SELECT a.\"FileName_Hosted\"
FROM \"TableOccurences\" a
WHERE a.\"ExternalFileLayoutName_Hosted\" = ?" ;

// ------------  END QUERY ------ ------

"    " ; "|*|" ;

// ------------  BEGIN ARGUMENTS ------------ 

$LayoutName

// ------------  END ARGUMENTS ------------ 

 ) ] ;

// ------------  BEGIN CARIAGE RETURN SUBSTITUTIONS ------------ 

 Substitute ( SQLResult ; [ ¶ ; ReturnSub ] ; [ "|*|" ; ¶ ]  )

// ------------  END CARIAGE RETURN SUBSTITUTIONS ------------ 

)

// Compliments of SeedCode… Cheers!

// ------------  END EXECUTESQL BLOCK ------------ 


That's it!
John Sindelar
SeedCode

Return to GoZync

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: