SynchPlugIn: How To Skip Synching A Contact
I am trying to synch ContactEmployees from SBO to Web Tools. I am using a SynchPlugin with SynchType SBOObjectTypes.BusinessPartners and SynchRunTime PluginExecutionLocation.AfterSynch. The reason I need to write the ContactPlugIn is because I am only going to synch those contacts that have unique emails, throwing an exception for those that are duplicated elsewhere in the SBO DB. I had originally thought I could use the SBOQueueObject.ToggleSkip* method (the qData* variable in the SamplePlugin), but even if that did what it sounded like it did (Does it? There's no documentation on it, is there?), I think what will happen is the entire BusinessPartner will be skipped, not the individual ContactEmployee. How can I skip a specific ContactEmployee or ContactEmployees from a BusinessPartner on a ContactEmployee by ContactEmployee basis?
If this is not possible, there is one other possibility: could I wait until after the synch has completed, create a separate ContactPlugIn with SynchRunTime PluginExecutionLocation.AfterSynch, and manually wipe out the email address. While this is a much less elegant solution, it's something I can live with should there be no way to do the former.
Toggle skip does what you imagine, unfortunately, proably not how you imagine it should do it.
The first thing to note about the synch, is that a snapshot of the PRX_Transaction_Queue is loaded into memory at the start of the synch and this is the queue that is used during the synch. When the synch is done, those records that successfully synchronized are deleted from the PRX_Transaction_Queue. (Maybe you knew all that).
The toggle skip was really written for the UI toggle in the synch manager and it does not operate on the queue in memory. It updates the DB, so the next synch would skip the record. (This should probably be considered a bug, but, that's what it does right now).
I think you can accomplish what you want in the following way:
1. run the plugin before the synch
2. manually update the in memory queue data using SBO_Queue_Object (the qData arg) passed to the plugin, rather than using toggle skip
3. manually update the PRX_Transaction_Queue with direct SQL to add the error message and set the status to skip.