Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hello!
Take a look at this
http://sdk.episerver.com/commerce/1.1.2/Content/Developers%20Guide/Tutorials/Training/TrainBusinessFoundation.htm
I think this small snippet below should get you on the right track
FilterElementCollection filterElementCustomer = new FilterElementCollection();
//Or use your custom business foundation field as filter element
filterElementCustomer.Add(FilterElement.EqualElement("Email", email));
EntityObject[] sortedListCustomer = BusinessManager.List
(CustomerContact.ClassName, filterElementCustomer.ToArray());
EntityObject customer = sortedListCustomer.FirstOrDefault();
if (customer != null)
{
customer.Properties["YourCustomBusinessFoundationField"].Value = "YourCustomValue"
Mediachase.BusinessFoundation.Data.Business.BusinessManager.Update(customer);
}
/M
Hi Michael,
Thanks for your reply. Using a filterelement I got it working.
var filterElement = new FilterElement("FBUserId", FilterElementType.Equal, (object)fbUserId);
var filterElementArray = new[] { filterElement };
var entityObjectArray = BusinessManager.List("Contact", filterElementArray);
if (entityObjectArray.Length == 1)
{ ... }
Hello all,
I want to be able to load a specific contact from the system by a value stored in a specific business foundation field. (in this case I want to load the contact by the facebook ID)
I have found a function that I think should be able to do this, but I have no idea how it works.
Can I use the CustomerContext.Current.GetContactsByPattern(string pattern) function to search for contacts? And what would the pattern look like?