Get(accountName) returns unexpected data. *RESOLVED*

Help, Tips, and Tricks for deploying GoZync: our "sync" engine for FileMaker Go.
Posts: 22
Joined: Sun Jan 29, 2017 5:05 pm
PostPosted: Thu Mar 15, 2018 4:10 pm
I have a solution that runs on an iPad.

Each iPad can be used by more than one user.

As each user moves around the country, they are able to select and change their 'Service Region', and on the next sync, see just the work for that Service Region.

All of this works as expected on a PC.

However, it breaks on an iPad.

In the GZM script 'Specify User Defined Search Criteria' I use get(AccountName) to find country and service regions for the logged-in user.
Capture.PNG
Capture.PNG (15.62 KiB) Viewed 25313 times

The variables are then used to declare additional filter criteria
Capture2.PNG
Capture2.PNG (22.12 KiB) Viewed 25313 times


When I run a sync on the iPad, Get(AccountName) returns 'Sync' and Get(UserName) returns the User Name configured in FMGo - Settings. I would prefer not to use Get(userName) as it will complicate matters when changing iPad users.

Are the results seen the expected behavior?
Last edited by Frostie on Sun Mar 25, 2018 1:14 pm, edited 1 time in total.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Fri Mar 16, 2018 10:03 am
Hi Frostie,

Since the user logged into GoZyncMobile is the 'Sync' user, I think you'll want to be getting the account name in the "Filter Records To Pull" script in your hosted file, rather than in the scripts in GoZyncMobile. We've got some more detailed info on this in our Downloading Found Sets documentation here: https://www.seedcode.com/pmwiki/index.p ... gFoundSets

We mention putting Get(UserName) in the GoZyncMobile file, as you won't be able to get that information from your hosted file. But the FileMaker account name is available in the "Filter Records to Pull" script because the signed in user is being used to access the data.

Let me know if that works for you.

Regards,

KC
Posts: 22
Joined: Sun Jan 29, 2017 5:05 pm
PostPosted: Mon Mar 19, 2018 4:25 pm
Thanks KC,

I have re-vamped the way I was looking for 'Service Regions' and renamed occurrences of the 'Employee' Table/T.O.'s so that they sync first.

Many thanks for the advice and guidance.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Mon Mar 19, 2018 5:04 pm
Awesome, Frostie!

Thanks for the update.

Regards,

KC
Posts: 22
Joined: Sun Jan 29, 2017 5:05 pm
PostPosted: Wed Mar 21, 2018 5:45 pm
Or at least I thought it was fixed.... (sigh)

I tested using the user PaulS, from an iPad, and all was as expected. Changing the service regions changed the records downloaded.

To-day I tried using a different user from an iPad, and I keep getting the records for PaulS. No matter who I logged in as, the found set was always for PaulS

I closed down FMPA, re-started FMP Server, and tried again - same result. Looking at a log file I am creating in the hosted file I see this entry:-

"UserName Get IDS Needed For Sync PSOS - PaulS17796 AccountName pauls $user_id is PaulS"

in response to this code at the start of the 'Filter records to Pull' script. The log entry is the same no matter who is logged in. The only thing that changes is a number (17796) that increments by 2, and is reset to 2 when the hosted filed is closed and reopened.
Capture.PNG
Capture.PNG (20.16 KiB) Viewed 25273 times


Sorry to be a pain, but what have I missed or misunderstood??

Many thanks,

Frostie.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Thu Mar 22, 2018 8:10 am
Thanks for the details, Frostie.

When users open the mobile file, are they being prompted to login, or is it automatically logging in (possibly with the PaulS FileMaker account)?

KC
Posts: 22
Joined: Sun Jan 29, 2017 5:05 pm
PostPosted: Thu Mar 22, 2018 4:04 pm
Hi KC.

The solution is using the separation model. On the iPad there is an interface file that the user logs into, a Mobile data file, and GZM.

On the server there is GZH, and a hosted data file. Syncing takes place between the mobile and hosted data files.

I have verified that when each of the three solution files are individually opened, a username and password is required. I have also double checked that there are no entries in File > file options > open, log in using...

Still seeing the same username in the solution log file, no matter which iPad is used or which user logs in. :?
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Fri Mar 23, 2018 7:59 am
Thanks, Frostie.

I'm going to reach out to Todd regarding this and see if he has any input. I'll also reach out to you via email to get a little more detail and we can post the resolution here.

Thanks!

KC
Posts: 22
Joined: Sun Jan 29, 2017 5:05 pm
PostPosted: Sun Mar 25, 2018 1:12 pm
Looks like I may have found the problem....

Whilst the hosted file did not have a username and password entered in File Options, the tick box for 'Allow Credential Manager to save password' was however... ticked.

How I could state on Friday that:-
I have verified that when each of the three solution files are individually opened, a username and password is required.
after what I thought was quite careful verification, I can't explain...

I need a break... I really need a break!

Apologies to you and Todd for time wasting, and thanks again for your patience and support.

Frostie.
SeedCode Staff
SeedCode Staff
Posts: 357
Joined: Tue Nov 08, 2016 1:54 pm
PostPosted: Mon Mar 26, 2018 10:03 am
Nice job on finding the resolution, Frostie!

Thanks for posting the info. Sounds like it's time to treat yourself to a bit of a break, then dive back in!

As always, let us know if you have any further questions.

Regards,

KC

Return to GoZync

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: