Try our conversational search powered by Generative AI!

Custom EPiServer CMS Property


I'm looking to create a custom CMS property and that saves values to the Commerce DB instead of the CMS DB. The values would have to be parsed to save the data accordingly. For example:

USA=Estados Unidos,

Is this possible to create a custom property to parse this and save it to a newly created business foundation object?

Apr 24, 2013 16:25


Why do you want to save the data for your CMS property in a Commerce object instead of the actual CMS object? What is it that you are trying to achieve?

Apr 25, 2013 7:40

Yes I want to save it as a Commerce object instead of a CMS object. After doing more research on the issue, I see that there is a CountryDto and a CountryManager. Is there a way to extend these classes and to accomodate country name translations?

Apr 25, 2013 18:55


Though you can do pretty much anything in a custom property I have never heard about someone doing something like this. The reason for this is that a custom property is just a piece of code that handles a bit of data. It does not know much about the parent object or it's life cycle. The normal aproach when dealing with other systems is to make a property that holds a reference to an object stored elsewhere, but not to actually create and manage this object.

If you need to do this I would probably add an event handler to the parent object (for instance a page) and make sure that I update the external system (for instance Commerce) whenever the object is being published.

Apr 26, 2013 7:28

I agree, hooking up on for example SavingPage or SavedPage event seems a bit more kosher

Apr 26, 2013 9:03

Cool. Thanks for the explanation. It makes a lot more sense.

Apr 26, 2013 13:30

Quick update:

I've tried what you suggested and it works so far. The question I have now is where is the SavingPage or SavedPage method? I only see SaveData method and I don't think I'm suppose to be using this to save/merge changes to the DB.

Apr 29, 2013 17:39

Check out the PublishingContent event on DataFactory.Instance. You can also fetch out the registered instance for the interface "IContentEvents" if you want to work with the IOC container for testability.

Apr 29, 2013 17:50

So I would have to modify the save method in the PageType that uses the custom property? There isn't a way to do this in the custom property itself?

I'm sorry for importuning you guys with questions. I'm still new to EPiServer and still learning the EPiServer system.

Apr 29, 2013 18:44
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.