using (UniversalContactServerProtocol ucsConnection = new UniversalContactServerProtocol(new Endpoint("UCS", ucsHost, ucsPort)))
{
ucsConnection.Open();
//look for the contact based on customerNumber
var search = new RequestSearch();
search.Query = "CustomerNumber:2655486";
search.IndexName = "contact";
var searchResult = (EventSearch)Convert.ChangeType(ucsConnection.Request(search), typeof(EventSearch));
if (searchResult.Documents.Count > 0)
{
//assume doc[0] has what im looking for
//get contactId - should be Guy ingram
var contactId = searchResult.Documents[0].Fields["Id"].ToString();
var attributeReq = new RequestUpdateAttributes();
attributeReq.ContactId = contactId;
attributeReq.TenantId = 1;
genCon.AttributesList cl = new genCon.AttributesList();
var attr = new genCon.AttributesHeader();
attr.AttributesInfoList = new genCon.AttributesInfoList();
attr.AttributesInfoList.Add(new genCon.AttributesInfo() { AttrId = "00001aB9HP0B000P", AttrValue = "foo", });
cl.Add(attr);
//now changing Guy's lastname to "foo"
attributeReq.UpdateAttributes = cl;
var returnVal = ucsConnection.Request(attributeReq);
}
}
The above code is finding a user within UCS and updating an attribute. We have existing CRM system and we need to sync data from our existing CRM to UCS.
When I query the UCS db, I'm not seeing the attribute value change....Any help would be greatly appreciated.
this is my response:
{'EventUpdateAttributes' ('111')
message attributes:
ReferenceId = 2
}