I think I found a way to reach the objected of adding ContactAddress2 to the ContactInfo Class.
https://docs.kentico.com/k10/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-contacts/adding-custom-fields-to-contacts
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
https://docs.kentico.com/k10/custom-development/creating-custom-modules/initializing-modules-to-run-custom-code
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);
contactDependencies.Add(contactAddress2);
}
}