我创建了一个新的CRM实体,其中包含2个字段Name和Value。在我的C#代码中,我从Microsoft Unified Service Desk提取了两个相同的值及其名称。现在,我在C#代码中有这些记录,现在我想将它们保存在CRM实体中。我现在使用下面的代码来获取值,
string QuestionAnswer = string.Empty;
if (dialog.QuestionControlValidate)
{
if (ContextParameterName != string.Empty)
{
var ctx = Context.GetContext();
if (dialog.QuestionControlType == "TextBox")
QuestionAnswer = dialog.QuestionControlTextQuestionAnswer.ToString();
else if (dialog.QuestionControlType == "RadioButton")
QuestionAnswer = dialog.QuestionControlRadioButtonSelectionAnswer.ToString();
var updatedContext = new Context(ctx)
{
[ContextParameterName] = QuestionAnswer
};
// Code to be added here
}
我在ContextParameterName中获取名称,在QuestionAnswer中获取值。我想将这些记录存储在具有名称和值字段的CRM实体中。
我正在C#代码中从Microsoft USD获取数据,然后将其保存在CRM实体中。而且由于以美元为单位,因此该连接是使用CRM环境自动创建的,因此我无需明确定义连接即可实现该连接。
dictionary.Add("name", new CrmDataTypeWrapper(ContextParameterName, CrmFieldType.Raw));
dictionary.Add("value", new CrmDataTypeWrapper(QuestionAnswer, CrmFieldType.Raw));
dictionary.Add("id", new CrmDataTypeWrapper(updatedContext["Id"], CrmFieldType.Raw));
Guid EvntId = _client.CrmInterface.CreateNewRecord("historicaldata",dictionary,"",false,new System.Guid());
该CreateNewRecord方法创建针对目标实体类型的新活动
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句