无法通过程序更新社交媒体资料上的影响力评分

8
我们有一个新设置的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
  • 如果是,正确的更新方式是什么?

我认为你应该先删除当前的分数,然后再添加新的分数。 - Deepak Bhatia
我无法删除分数或将其设置为“null”,因为SDK忽略了该字段上的我的“UpdateRequest”。 - mehmetseckin
1个回答

2

我查看了socialprofile实体的元数据,发现influencescore属性的IsValidForUpdate属性设置为False。虽然在创建时可以设置它(即IsValidForCreate为True),但不能更新。


我所做的第一件事是在属性元数据表中查找,如果我们在数据库上将IsValidForUpdate属性设置为true,并使用SQL更新(这是高度不支持的),结果我们可以使用SDK请求更新属性。但是这背后的原因是什么?为什么SocialCare想要防止对InfluenceScore属性进行更新? - mehmetseckin

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接