dynamic crm js怎么更改statecode
答案:2 悬赏:0 手机版
解决时间 2021-03-24 15:04
- 提问者网友:泪痣哥哥
- 2021-03-23 18:28
dynamic crm js怎么更改statecode
最佳答案
- 五星知识达人网友:神的生死簿
- 2021-03-23 19:17
CRM系统中的statecode字段很特殊,js端不能直接进行跟新。
Plugin 更新时也很特殊具体更新方法如下:
/// <summary>
/// 更新【状态】字段为停用
/// </summary>
/// <param name="orgService"></param>
/// <param name="entityName"></param>
/// <param name="id"></param>
/// <param name="statecode">1:停用</param>
/// <param name="statuscodeValue"></param>
private void updateStateCode(IOrganizationService orgService, string entityName, Guid id, int statecode, int statuscodeValue)
{
SetStateRequest setStateReq = new SetStateRequest();
setStateReq.EntityMoniker = new EntityReference(entityName, id);
setStateReq.State = new OptionSetValue(statecode);
setStateReq.Status = new OptionSetValue(statuscodeValue);
SetStateResponse response = (SetStateResponse)orgService.Execute(setStateReq);
}
Plugin 更新时也很特殊具体更新方法如下:
/// <summary>
/// 更新【状态】字段为停用
/// </summary>
/// <param name="orgService"></param>
/// <param name="entityName"></param>
/// <param name="id"></param>
/// <param name="statecode">1:停用</param>
/// <param name="statuscodeValue"></param>
private void updateStateCode(IOrganizationService orgService, string entityName, Guid id, int statecode, int statuscodeValue)
{
SetStateRequest setStateReq = new SetStateRequest();
setStateReq.EntityMoniker = new EntityReference(entityName, id);
setStateReq.State = new OptionSetValue(statecode);
setStateReq.Status = new OptionSetValue(statuscodeValue);
SetStateResponse response = (SetStateResponse)orgService.Execute(setStateReq);
}
全部回答
- 1楼网友:春色三分
- 2021-03-23 20:05
好的
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯