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 4908 posts 12265 karma points MVP 4x admin c-trib
    Aug 25, 2016 @ 08:18
    Jeroen Breuer
    0

    uSync and create only dictionary handler

    Hello,

    I've using this example to only create a dictionary item if it doesn't exist: https://gist.github.com/jamiepollock/5440e7d3c12fceaa4134

    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 3.1.5.740. Anything else I need to do to get this working?

    Jeroen

  • Kevin Jump 2309 posts 14673 karma points MVP 7x c-trib
    Aug 25, 2016 @ 08:35
    Kevin Jump
    1

    hi

    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:

Draft