Dynamics CRM 4.0 J 脚本 - “If”使用状态代码的语句
我正在尝试创建一个简单的警报作为联系人实体上的 onload
事件。但是,我只希望在条件之一是联系人仍处于活动状态时触发此操作。
因此,我将其如下:
if (crmForm.all.statecode.DataValue == 0)
{
alert("'Whatever alert I want") ;
}
但是,当我加载联系人记录时,它出现错误。是否不可能将“if”语句建立在状态的基础上?
I am trying to create a simple alert as an onload
event on the contact entity. However, I only want this to trigger if one of the conditions is that the contact is still active.
I therefore put it the following:
if (crmForm.all.statecode.DataValue == 0)
{
alert("'Whatever alert I want") ;
}
However, when I load the contact record it errors. Is it not possible to base an 'if' statement on the status.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您想要的是 crmForm.FormType 枚举:
http: //mscrm-developer.blogspot.com/2008/09/crm-form-types.html
crmForm.FormType == 4 表示表单已停用(状态代码 1),因此您可以执行类似的操作
只是要小心现有的所有各种表单类型,并确保您在想要的地方收到警报。
I think what you want is the crmForm.FormType enumeration:
http://mscrm-developer.blogspot.com/2008/09/crm-form-types.html
crmForm.FormType == 4 means the form is deactivated (statecode 1) so you could do something like
Just be cautious of all the various form types that are out there and make sure you get the alert where you want it.