My sync process is finally working. I managed to identify the cause of the problem and found a workaround. Unfortunately, I still haven’t found the cause or a solution, just a workaround. As I’ve always said when it comes to anything FileMaker related, where there’s a need, there’s a workaround. So, here’s my journey and I hope that if this ever rears its’ ugly head to anyone else, this post will help diagnose and solve the problem.
Whenever I ran the sync process in my mobile file, it would always fail with an error 106 (Table missing). I had thoroughly checked every single TO and relationship in both files literally hundreds of times and everything was exactly as it should be.
Eventually, I ran the script with the debug pull payload option switched on. If you’re ever tried that, you’ll know how painful it is. After hitting the enter key several thousand times (four times per record), it eventually stopped, allowing me to see the problem. The primary table in the process was using a TO named ES_Projects, however the script was showing it as ?[[bR]]ES_Projects. I have no idea what the ?[[bR]] prefix means or what caused it. At least I knew where the problem was occurring. I deleted the TO’s in both files and replaced them with new ones and even renamed them to ES_PROJ.
I ran the sync script again and it failed yet again with a 106 error. The difference this time is that it had processed more records than the previous attempt. Working backwards through the list of TO’s and manually finding the number of records to be processed, I identified that the problem was with the next table after the projects one. I disabled the relationship in both files and renamed the TO’s and ran it again. The same problem occurred, this time with the next table. The conclusion I came to was that the sync process would get to a certain point and then fail. If I disabled the process at the fault, it would simply move the problem to the next table.
I was able to identify the table name variable and put it onto the EasySync Payloads layout as a merge variable so I could at least see the faulty table name. Each and every time, the failure point included the same prefix of ?[[bR]]. After digging through the pull payload script, I found where the $table_name variable was set and added a variable after it which set $table_name to Substitute($table_name; “?[[bR]]”; “”). On the first attempt, it still failed. I went back in and found the next occurrence of the set variable, copied my script step to below that and ran it again.
Lo and behold, the sync worked perfectly and has ever since. As I said at the beginning, this is a workaround and not a solution. The process is still adding the prefix, I’ve just figured out how to repair it. I still have no idea what the prefix means or how it got there. If anyone can shed any light on it, I’d be most appreciative. I’m just relieved that it’s over…for now.
Marc