当前位置:网站首页>Dynamics crm: understand status, statecode, status reason, statuscode
Dynamics crm: understand status, statecode, status reason, statuscode
2022-07-22 07:39:00 【Stone-hdj】
The four mentioned above : status, statuscode, status reason, statuscode, It's just two fields , These two fields exist in every entity , Whether it's the system's own entity or our customized entity .
Field name | Display name | remarks |
statecode | Status | For custom entities , Its value is Active, Inactive If it is an entity of the system : 1. about case The value of an entity is Active, Resolved, Canceled 2. about Opportunity The value of an entity is Open, Won, Lost 3. image Knowledge Article, Lead, Invoice These systems also have more than two entities Status notes : Most entities , Include Dynamics CRM Self contained entity , Most of them are only Active and Inactive, Those above are special cases . |
statuscode | Status Reason | The value of this field is the same as the above status Fields with corresponding relationships , in other words : 1. every last Status Can correspond to multiple Status Reason 2. every last status reason Must belong to one Status, It can belong to Activce, It can also belong to Inactive, It can also belong to others |
about Status(statecode) Field , We can find that its data type is Status, And you cannot add custom options
about Status Reason(statuscode), This field is special , We can add new reason, It can also be for each reason Limit the circulation of , Like this :
1) Status Reason You can add , Delete , Sort, etc
2) You can use "Edit Status Reason Transitions" Buttons for each status reason The next step is optional reason Options to limit , I will explain this in detail in the next blog :
Usually , The custom entity we created status There are only two states , Active and Inactive.
And its corresponding Status Reason It's also everyone Status Have the same value , for instance Status yes Active, So the corresponding Status Reason It's also Active, Except for the customized one .
The following table shows the values of these two fields in the database in different states :
statuscode(Status Reason) | 1 - Active 2 - Inactive |
statecode(Status) | 0 - Active 1 - Inactive |
The following is to change a record into active perhaps inactive Of C# Code , For reference only :
// enable a record
public static void EnableUser(IOrganizationService service, string entityName, Guid recordID)
{
UpdateState(entityName, recordID, 0, -1, service);
}
// disable a record
public static void DisableUser(IOrganizationService service, string entityName, Guid recordID)
{
UpdateState(entityName, recordID, 1, -1, service);
}
private static void UpdateState(string enName, Guid id, int state, int status, IOrganizationService service)
{
SetStateRequest setState = new SetStateRequest()
{
EntityMoniker = new EntityReference()
{
Id = id,
LogicalName = enName
},
State = new OptionSetValue(state),
Status = new OptionSetValue(status)
};
service.Execute(setState);
}
In the above code status If the value of is -1, The default value will be used
Reference link :
边栏推荐
- kettle入门杂乱笔记
- 使用C#控制台程序读取Azure Service Bus队列中的消息
- 手机对比redmi note8与realme x2
- 软件推荐-网站建设
- Yyds dry goods inventory # solve the real problem of famous enterprises: how many people will little a meet at most
- 益盟操盘手软件可靠么?买股票安全吗?
- Encryption crash, Web3 is dead?
- 287寻找重复数
- Dynamics CRM: XrmToolBox插件推荐
- Dynamics CRM: 关系Relationships(2) - N:N 多对多
猜你喜欢
Architect growth: when it comes to architecture, what is it
Dynamics CRM: 在Form的导航中添加Process Sessions以便于查看workflow的运行历史
使用js实现点击事件
电脑上如何开启多个微信,微信多开
Dynamics CRM: 遇到“The plug-in execution failed because no Sandbox Hosts are currently available.“
"New energy + energy storage" starts from the digital twin, Tupu will make smart power to the extreme
Keras深度学习实战(13)——目标检测基础详解
Crazy God redis notes 06
Dynamics 365: how to remove the restriction that an entity can only create two access team templates
31下一个排列
随机推荐
关于sql数据查询的语句
Dynamics 365: 查找哪些记录使用Access Team这种方式分享给了某一个User
Dynamics CRM: 邮箱配置(二) - 对于Dynamics CRM中收不到邮件的可能原因之一
Dynamics 365: how to remove the restriction that an entity can only create two access team templates
numpy数组访问的效率研究
G026-DB-GS-INS-03 OpenEuler 部署 OpenGauss(1主2备或多备)
Keras deep learning practice (12) -- facial feature point detection
電腦上如何開啟多個微信,微信多開
"New energy + energy storage" starts from the digital twin, Tupu will make smart power to the extreme
HashSet of set
第一个微信小程序的初始化过程、小程序微信开发平台的下载、如何注册一个微信小程序的账号
Keras深度学习实战(14)——从零开始实现R-CNN目标检测
主机psql连接虚拟机Oracle
Web3, encrypted VC new air outlet
CodeSys中编程实现串口通讯【基于树莓派4B】
Scala函数及其高阶应用
Tmech publishes the latest progress in the operation control technology of the must choose: to realize the high robustness walking of humanoid robots
Keras deep learning practice (14) -- r-cnn target detection from scratch
吃了爱优腾的药,奈飞病情好转
mysql中的字段如何选择合适的数据类型呢?