Copied to clipboard

Flag this post as spam?

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


  • Barry Fogarty 493 posts 1129 karma points
    May 22, 2012 @ 10:05
    Barry Fogarty
    0

    Setting EC data with the API

    It would be good if it was possible to set data via the API for embedded content fields.  I have a new document event handler and I have tested setting the field with hardcoded data.  e.g.

    var prop = sender.getProperty("alias");
    if (prop != null) prop.Value = "test hard coded value";


    Stepping though the code, this value is inserted in the database but by the time the process finishes it has defaulted to "<data></data>".

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 22, 2012 @ 12:54
    Jeroen Breuer
    0

    The value is stored as xml so perhaps you should also insert it in an xml format.

    Jeroen

  • Barry Fogarty 493 posts 1129 karma points
    May 22, 2012 @ 16:21
    Barry Fogarty
    0

    Thanks Jeroen - it tried that I actually think now it is a conflict with Bo's (brilliant) Standard Values package.  It sems that sets a default value of <data></data> AFTER my event has run.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 22, 2012 @ 16:41
    Jeroen Breuer
    0

    I think the order in which the events is fired is alphabetical. As you can see in the source of the Standard Values package the namespace is Sitereactor.StandardValues.Events. So if you create an event which has a namespace which starts with a z (might be good to let your assembly also start with that) your event might be called later.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft