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>".
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.
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.
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.
Stepping though the code, this value is inserted in the database but by the time the process finishes it has defaulted to "<data></data>".
The value is stored as xml so perhaps you should also insert it in an xml format.
Jeroen
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.
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
is working on a reply...