在 Dynamics CRM 4.0 中使用 javascript 计算年龄
首先,我对Dynamic crm非常陌生。
我有这样的情况,我必须计算案件发生的人的年龄 并且涉及人员类型为“投诉人”,
因为我们有3个客户实体
new_Case
Occurrence Date
new_involvePerson
Involved Person Type(following are types)
- Complainant
- Supervisor
- Investigator
and New_person
- DOB
现在,用户更新事件中的发生日期,我必须计算投诉人涉及人员的年龄
当事件案例保存时,是否可以在Javascript OnSave中执行此操作? 或者我必须创建工作流程或插件吗?是否可以获得示例代码
提前致谢
First of all, I am very new in dynamics crm.
I have situation where I have to calculate the age of person where case occurred
and involved person type is "Complainant"
For that we have 3 Custome Entity
new_Case
Occurrence Date
new_involvePerson
Involved Person Type(following are types)
- Complainant
- Supervisor
- Investigator
and New_person
- DOB
Now, user update the Occurrence Date in Incident, I have to calculate age of complainant Involved Person
Is it possible to do in Javascript OnSave when Incident Case save?
Or do i have to create a workflow or Plug-in? Is it possible to get the sample code
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

是的,这是可能的。您只需编写一个函数并在保存事件表单时触发它。
检查 Occurence Date 是否不为空,然后检索 new_involvePerson 的类型,如果等于 Complainant,那么您只需检索volvePerson 的出生日期并计算年龄就很容易了。
Yes it's possible. You just have to write a function and trigger it on the on save of the incident form.
Check if Occurence Date is not empty then Retrieve the new_involvePerson's type and if that equals Complainant and then it's easy you just Retrieve the involvePerson's date of birth and calculate the age.