Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jeroen Breuer 4861 posts 12130 karma points MVP 3x admin c-trib
    Aug 25, 2016 @ 08:18
    Jeroen Breuer

    uSync and create only dictionary handler


    I've using this example to only create a dictionary item if it doesn't exist:

    I've added the class to my project and added it to the uSyncBackOffice.Config, but nothing happens if I create or save a dictionary item. I'm using uSync Anything else I need to do to get this working?


  • Kevin Jump 1701 posts 10914 karma points MVP 4x c-trib
    Aug 25, 2016 @ 08:35
    Kevin Jump


    i think that create only handler does have the register events, set so it doesn't do the save or create stuff.

    I think it was written for a target machine only ?

    However usync 3.2++ super feature B means ...

    you can now enable handlers for specific events.

    handler actions means you can specify a handler only working for key things

    <HandlerConfig Name="handler" Enabled="true" Actions="All,Import,Export,Events" />

    the action needs to just be a CSV of possible actions,

    you could using the existing handler for Events, and Exports and the read only for import

    <HandlerConfig Name="uSync: DictionaryHandler" Enabled="true" Actions="Events,Export" />
    <HandlerConfig Name="uSync: CreateOnlyDictionaryHandler" Enabled="true" Actions="Import"/>

    then the import will only put new things in, and your saves and creates will still be written to disk

    this and handler groups came in v3.2 (see issue for more info), I am writing some of this up so its less luck that people find this stuff :)

Please Sign in or register to post replies

Write your reply to: