我们有一个新设置的CRM 2015 On-Premise环境; 我们正在使用社交关怀框架进行一些调试。
我们只是希望在自定义应用程序中使用Web服务调用更新社交个人资料记录的InfluenceScore
参数,但它似乎对该字段没有影响。 奇怪的是,它不会抛出任何异常,服务调用也没有任何错误提示。 一切似乎正常,除了该字段未被更新。
以下是我们代码的相关部分;
// 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
? - 如果是,正确的更新方式是什么?