Skip to content

Instantly share code, notes, and snippets.

@dnstommy
Created November 30, 2016 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnstommy/86a3245ada37216235116825c2df1d05 to your computer and use it in GitHub Desktop.
Save dnstommy/86a3245ada37216235116825c2df1d05 to your computer and use it in GitHub Desktop.
var companyInformationFacet = Tracker.Current.Contact.GetFacet<IContactCustomerLookups>("CompanyInformation");
if (!companyInformationFacet.Entries.Contains(CleanName(model.data[0].name)))
{
var customer = companyInformationFacet.Entries.Create(CleanName(model.data[0].name));
customer.name = model.name;
customer.CID = model.CID;
customer.category = model.category;
customer.city = model.city;
customer.confidence = model.confidence;
customer.country = model.country;
customer.countryShort = model.countryShort;
customer.employees = model.employees;
customer.facebook = model.facebook;
customer.isISP = model.isISP;
customer.latitude = model.latitude;
customer.linkedIn = model.linkedIn;
customer.linkedInID = model.linkedInID;
customer.longitude = model.longitude;
customer.phone = model.phone;
customer.postal = model.postal;
customer.region = model.region;
customer.regionShort = model.regionShort;
customer.revenue = model.revenue;
customer.sicCode = model.sicCode;
customer.stockSymbol = model.stockSymbol;
customer.street = model.street;
customer.twitter = model.twitter;
customer.website = model.website;
customer.isISP = model.isISP;
customer.confidence = model.confidence;
customer.modified = DateTime.Now;
}
private string CleanName(string name)
{
return name.Replace(".", "").Replace(",","");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment