在Dynamics CRM中计算年龄 [英] Calculate age in Dynamics CRM

查看:122
本文介绍了在Dynamics CRM中计算年龄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以有两个类似的问题,但是所有人都在使用javascript,这不是理想的选择,因为它需要打开/保存记录。

So there are a couple of similar questions, but all are using javascript, which isn't ideal as it requires the record to be opened / saved.

所以,如何根据出生日期计算年龄。有200,000条记录需要完成,并且使用CRM 2015,因此也可能涉及计算字段。

So, how can you calculate age based off birthdate. There are 200,000 records this would need to be done on and it's using CRM 2015, so can involve calculated fields as well.

它将在后台进行报告,因此,我们不能使用Javascript。

It's going to be reported on in the background, so we can't use Javascript.

工作流是有可能的,但是每天在200,000条记录上运行它们并不完美!

Workflows are a possibility, but running them on 200,000 records daily isn't exactly elegant!

还有其他建议吗?

推荐答案

我已经多次遇到了这个要求。
我已经解决了这一问题,方法是编写一个Scribe或SSIS作业,该作业每晚运行一次并更新Contact.Age字段。

I've come across this requirement a number of times. I've solved it by writing a Scribe or SSIS job which runs nightly and updates the Contact.Age field.

为了不更新每个Contact记录在计算出的年龄(大多数年龄不会改变)的情况下,我使用以下其中一项:

In order to not update every Contact record with the calculated age (as most ages won't have changed), I've used one of the following:

对于内部CRM(我具有SQL访问权限)到数据库),我写了一个查询返回:
contactid
contact age
contact DoB
计算出的年龄(来自DoB和getdate的计算出的列)

For on-premise CRM (where I have SQL access to the database), I wrote a query to return: contactid contact age contact DoB calculated age (calculated column from DoB and getdate)

抄写员或SSIS作业只会更新Contact.Age!= CalculatedAge

The Scribe or SSIS job would only update records where Contact.Age != CalculatedAge

对于托管CRM(我没有SQL的记录)访问数据库):
添加一个名为下一个生日的字段

For hosted CRM (where I don't have SQL access to the DB): Add a field called 'Next birthday'

抄写员/ SSIS作业将搜索NextBirthday为空或今天之前的记录。它将更新年龄和下一个生日字段。

The Scribe/SSIS job would search for records where NextBirthday is null or prior to today. It would update the Age and NextBirthday field.

这两种方法都意味着,如果夜间作业由于某种原因而无法运行,那么下次运行时,它将追赶现在已经超出的任何记录日期。

Both of these methods mean that if the nightly job doesn't run for whatever reason, then when it's next run it will catch up on any records that are now out of date.

这篇关于在Dynamics CRM中计算年龄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆