Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added missing link to https://luminix.atlassian.net/wiki/spaces/PD/pages/710410241/Pulsar+SFS+UI+Customizations#Pulsar-SFS-Functions

...

  • Previous Sync Date/Time

    • The sync completed prior to the most recent sync.

  • Last Successful Sync Date/Time

  • Last Failed Sync Date/Time

  • Last Failed Sync SuccessError Code

    • Returns YES if the last sync was successful, and returns NO otherwise

  • Last Sync Duration

    • Number (#.#) of seconds that the sync took

  • Sync Generation

    • Number of total sync passes since app was installed 

  • Sync Pass Count

    • Number of passes that were performed with the last sync

  • Sync Domain Type

    • all = standard initial a three or four digit number representing the specific error that caused sync to fail, or zero if sync has never failed (Pulsar Error Codes).

  • Last Failed Sync CURL error code

    • Return a one or two digit number representing the CURL network communication error that led to a sync failure, or zero if there was CURL error.

  • Last Failed Sync CURL error message

    • Returns a message associated with the CURL error code if available.

  • Last Failed Sync Salesforce error code

    • Returns the error code from Salesforce as an alphanumeric string if applicable.

  • Last Failed Sync Salesforce error message

    • Returns a message associated with the Salesforce error code.

  • Last Failed Sync HTTP response code

    • Returns a three digit code plus brief descriptive text corresponding to the code. This is only reported when CURL reports an error or Salesforce’s response contains no body.

  • Last Sync Success

    • Returns YES if the last sync was successful, and returns NO otherwise

  • Last Sync Duration

    • Number (#.#) of seconds that the sync took

  • Sync Generation

    • Number of total sync passes since app was installed 

  • Sync Pass Count

    • Number of passes that were performed with the last sync

  • Sync Domain Type

    • all = standard initial or catchup sync,

    • mini = catch-up sync with a subset of objects,

    • single = a sync that at minimum syncs a single object, but can also sync up to one level above (via parent/lookup relationships) and one level below (via child relationships)

    • push = a sync that only pushes local changes to the server.

  • Sync Window Type

    • initial = The first sync performed after installing the app.

    • catchup = Any sync that is performed after the initial sync and is not a complete sync.

    • complete = A sync that is not an initial sync, but is performing a full sync due to a setting change.

  • Sync Resumed

    • Returns YES if the last sync was a continuation of an incomplete sync, and returns NO otherwise

  • Schema Changed

    • Returns YES if the last sync detected a schema change and performed a schema migration, and returns NO otherwise

  • Refresh Performed

    • Returns YES if the last sync resulted in refreshing the session and settings before sync began, and returns NO otherwise

  • Refresh Duration

    • Number (#.#) of seconds that refreshing the settings and session took

  • Metadata Sync Performed

    • Returns YES if the last sync performed a metadata sync, and returns NO otherwise

  • Metadata Sync Duration

    • Number (#.#) of seconds that the metadata sync took

  • Reachability Sync Performed

    • Returns YES if the last sync performed a reachability sync, and returns NO otherwise

  • Reachability Sync Duration

    • Number (#.#) of seconds that a reachability sync took

  • Server Processed Count

    • Number of full or partial records retrieved from the server for any reason (total across all object types)

  • Server Processed Object Count Map

    • Returns a list of server processed counts by object type

  • Server Integrated Count

    • Number of retrieved records ultimately added or updated on the local device

  • Local Created Count

    • Number of local created records sent to the server 

  • Local Deleted Count

    • Number of local deleted Ids sent to the server

  • Local Updated Count

    • Number of local updated records sent to the server

  • Local Updated Unique Count

    • Number of unique updated records sent to the server. This can be less than Local Updated Count if your organization has enabled the chronological changes feature.

...

Code Block
languagejs
{
    "type": "syncinfoResponse",
    "object": "",
    "data": {
        "lastfailedsync": "1970-01-01T00:00:00.000Z",
        "lastsuccessfulsync": "2023-06-01T04:10:55.020Z",
        "previoussynctime": "1970-01-01T00:00:00.000Z",
        "lastsyncduration": "44.9",
        "lastsyncsuccess": "YES",
        "localchangespendingcount": "0",
        "localcreatedcount": "0",
        "localdeletedcount": "0",
        "localupdatedcount": "0",
        "localupdateduniquecount": "0",
        "metadatasyncduration": "9.4",
        "metadatasyncperformed": "YES",
        "reachabilitysyncduration": "0.0",
        "reachabilitysyncperformed": "NO",
        "refreshduration": "0.0",
        "refreshperformed": "NO",
        "schemachanged": "NO",
        "serverintegratedcount": "4304",
        "serverprocessedcount": "43044485",
        "serverprocessedcountserverprocessedobjectcountmap": "4485Account: 4000,Contact: 400,Case: 85",
        "syncdomaintype": "all",
        "syncgeneration": "1",
        "syncpasscount": "1",
        "syncresumed": "NO",
        "syncwindowtype": "initial"
    }
}

...

  • singleObjectSyncEnabled: Set to true to run a single object sync. This syncs a single (or root) object at minimum, but by default will retrieve all objects at one level above (parents) and one level below (children) the root object.

    • rootObjectId (required): The Id of the specific record you'd like to sync.

    • parentIdFieldList (optional): A list of reference type field names on the root object to also sync. If not specified, all objects referenced in all reference fields will be synced (for those object types already being synced). To disable this, you may specify a single invalid field (e.g. ["NONE"]).

    • childRelationshipList (optional): A list of child relationships on the root object to also sync. If not specified, all child relationships are utilized to sync objects at this level (for those object types already being synced). To disable this, you may specify a single invalid child relationship (e.g. ["NONE"]).

  • pushChangesSyncEnabled: Set to true to run a push changes sync. This skips directly to the sync stage that pushes all local changes to Salesforce.

  • useComposite: Set to true to explicitly use the Composite API. Currently, this applies only to push changes sync.

  • useCompositeGraph: Set to true to explicitly use the Composite Graph API. Currently, this applies only to push changes sync.

...

  • all local changes to Salesforce.

  • useComposite: Set to true to explicitly use the Composite API. Currently, this applies only to push changes sync.

  • useCompositeGraph: Set to true to explicitly use the Composite Graph API. Currently, this applies only to push changes sync.

Code Block
languagejs
var request = { 
	"type" : "syncdata",
	"data" : { } // empty object- this is required in the current API
};

bridge.sendRequest(request, function (results) {
	console.log('Javascript got its response: ' + results);
	if (results.type === "syncDataResponse")	{
		// successfully requested sync
	} else if (results.type == 'error') {
		 errStr = results.data;
		 alert('A problem occurred:\n' + errStr);
	}
});

...

Note

WARNING: Be aware of your context. If your document is running inside PulsarSFS, you should avoid using the add/remove handler functions on the bridge in favor of some methods that reside on the Pulsar SFS window object. Learn more about the Pulsar SFS window object: Pulsar  Pulsar SFS UI Customizations#Pulsar-FSL-Functions.

You can receive progress and completion notifications from javascript by registering handler functions with the Pulsar bridge. The available handlers are:

...