ContactInfo.ContactAddress2 in Kentico 10

David Pearson asked on January 12, 2018 14:41

I was wondering what other people are doing to record that ContactAddress2 since the property disappear with the update to Kentico 10. Is there another location for storing this?

Thanks David

Correct Answer

David Pearson answered on January 12, 2018 18:51

I over complicated the solution.

Best solutions: Add the field to the class in modules To retrieve and set the field treat it like any other custom field. (GetValue or SetValue) AddressLine2.Value = currentContact.GetValue("ContactAddress2", "");


0 votesVote for this answer Unmark Correct answer

Recent Answers

David Pearson answered on January 12, 2018 15:36

I think I found a way to reach the objected of adding ContactAddress2 to the ContactInfo Class.

First I added the field custom field to contacts using the link above.

Next I went to set up Initializing modules to run custom code

Initializing Modules

I was wondering about the Initializing Module class: I attempting to add Address2 to the module.
[assembly: CMS.RegisterModule(typeof(ContactModule))]

Am I am doing this Class correctly?

Here is the ApplicationInit bit:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CMS.ContactManagement;
using CMS.DataEngine;

[assembly: CMS.RegisterModule(typeof(ContactModule))]
/// <summary>
/// Summary description for ExtendContacts
/// </summary>
public class ExtendContacts : ContactInfo
    public ExtendContacts()
        // TODO: Add constructor logic here
    private static void ApplicationInit(object sender, EventArgs e)
        var contactDependencies = (List<ObjectDependency>)ContactInfo.TYPEINFO.DependsOn;
        var contactAddress2 = new ObjectDependency("ContactAddress2", ContactInfo.OBJECT_TYPE);

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.