EONE BLOG

Tech Tuesday: Restricting Dynamics CRM Dates To The Current Year


Working with date fields in data can be a challenge and one of those challenges is why you have this subject today. One of our customers asked me if we could restrict some Dynamics CRM data by only pulling records for the current year. I think a few other people may want to do something similar so here are the steps for doing this. (I used the Opportunity Entity but it will work for any Dynamics CRM date field)

1) Create a Global Variable called GBL_CURRENTYEAR

globalvariable


2) Create a Pre-Map Task to run a script and use the following to pull the current year: GBL_CURRENTYEAR = Date.Today.Year

script
3) Now we can edit the CRM Query to include the Criteria for the current year in what ever Date field you choose like below:
>=’GBL_CURRENTYEAR-01-01′ AND <=’GBL_CURRENTYEAR-12-31′

query-criteria
This will assist you in creating a restriction on any Dynamics CRM date field.

Thanks,
Chris

Leave a Comment





RECENT POSTS


Employee Spotlight: Robert Dehn
Dynamics 365 Business Central Integration Bootcamps in Summer 2020 - Hosted Online
Join eOne at Business Building Conference 2020!
Tech Tuesday: Business Central Item Image Web Service
2020 Popdock & SmartConnect Bootcamps (Updated)

POPULAR POSTS


2016 SmartConnect Integration Bootcamps
Tech Tues: Automatically refreshing Pivot Tables in Excel Refreshable Reports
Happy Thanksgiving from the eOne team!
New Releases of Extender and SmartList Builder
2017 SmartConnect Integration Bootcamps

CATEGORIES

ARCHIVES

open all | close all

TAGS

Business Central CRM Dynamics 365 dynamics crm Dynamics GP Dynamics NAV Econnect Employee Spotlight eone eOne News eOne Spotlight Events Excel Excel Report Builder Extender Extender Enterprise Flexicoder GP GPUG integration Meet the Team Microsoft dynamics crm Microsoft Dynamics GP Office Relationships partners Popdock release Reporting SalesForce SalesForce.com scripting SmartConnect SmartConnect.com SmartConnect Bootcamp SmartConnect Office Hours SmartList SmartList Builder SmartList Designer SmartView SQL Support Tech Tuesday Templates training Zendesk

Integrate & Automate without Any Code.

SmartList Data has Never Been Faster.

The Easiest Way to Report on GP Data.