NetTalk Central

Author Topic: Single Record Settings Table for syncing a Desktop Application  (Read 3488 times)

jtbogle@gmail.com

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Single Record Settings Table for syncing a Desktop Application
« on: November 01, 2020, 07:58:14 AM »
I am looking for an example app with the Single Record Settings Table created and in use for syncing with an API Sync Server.

Nettalk documentation reference below:
The application needs to be able to do the following;
Add a single record to the table if it does not already exist.
Prime the GUID field in the new record to a unique value.
Open a form to allow the user to edit the fields in this record (although the GUID of the record is not known at the time when the program is generated.)
Fortunately there is template support for a single record table, and this generates the necessary JavaScript to add the first record for you. The settings for this is on the Global Extensions, the "second" NetTalk global extension (Activate NetTalk Web Server), on the Apps / Settings Table tab. Enter the settings table here, as well as identify some common fields that might be in your table.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Single Record Settings Table for syncing a Desktop Application
« Reply #1 on: November 01, 2020, 11:34:57 PM »
Hi Jack,

Perhaps make a small example, based on the ideas in the doc, and submit that here, and I'll let you know if you are on the right track. Also keep it nice and small, and I'll include it in future builds.

cheers
Bruce

jtbogle@gmail.com

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Single Record Settings Table for syncing a Desktop Application
« Reply #2 on: November 02, 2020, 09:36:07 AM »
I assumed that I could use use a global variable on the ServerSync window and template in the Desktop app.
Glo:ServerUrl = 'http://192.168.86.9' [2012 Server, the sync with the API appears to be working when I type directly into the template settings.

! Sends the Sync command to the server for a single table. Processing will resume when
! the reply is returned into PageReceived.
SyncOne  ROUTINE
  SyncInProgress = true
  get(TableListQueue,CurrentTable)
  TableListQueue.TableName_Icon = 2 ! syncing
  put(TableListQueue)
  display(?TableList)
  if net.sync(Glo:ServerUrl,TableListQueue.ViewPointer,TableListQueue.stsKey,TableListQueue.TableName,TableListQueue.TablePrefix,TableListQueue.TableSyncAPI,Options,TableListQueue.EverythingAfter, TableListQueue.SkipRecords,TableListQueue.TimeStampFieldName,TableListQueue.ServerTimeStampFieldName) = Net:Ok
    TableListQueue.RecordsSent = net.RecordsSent
    put(TableListQueue)
  else
    do SyncOneFail
  end

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Single Record Settings Table for syncing a Desktop Application
« Reply #3 on: November 03, 2020, 07:17:02 PM »
Hi Jack,

In the example you sent me you put quotes around the url inside the variable.
Don't do that - the variable doesn't need quotes inside it.

cheers
Bruce