We have a newly set-up CRM 2015 On-Premise environment; and we're doing some fiddling with the Social Care framework.
We simply wanted to update a Social Profile record's InfluenceScore
parameter within our custom application using a web service call, but it appears to have no effect on the field.
Oddly enough, it does not throw any exceptions, and the service call does not complain at all. Everything seems normal, except the field is not being updated.
Here are the regarding bits of our code;
// Retrieving the social profile record with all it's columns
Entity socialProfile = GetSocialProfileByName(socialProfileName);
double score = 0;
string scoreField = "influencescore";
// If socialProfile contains our attribute, set it appropriately, otherwise add the attribute
if(socialProfile.Contains(scoreField))
{
score = socialProfile.GetAttributeValue<float?>(scoreField).GetValueOrDefault(0) + 10; // Add 10 to the existing score.
socialProfile[scoreField] = score;
}
else
{
socialProfile.Attributes.Add(scoreField, 10);
}
// Update the record.
service.Update(socialProfile);
InfluenceScore
to be updated externally? I looked at the metadata of socialprofile entity and found out that the influencescore attribute has its IsValidForUpdate property set to False. It can be set on create though (i.e. IsValidForCreate is True).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With