web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting date from Week number and day

(0) ShareShare
ReportReport
Posted on by 45

I have two fields in CRM representing a day of the week (day spelled out in text) and week of the month (numeric value 1-4). Getting curent year is not a problem. The idea is to represent a very specific day of each month we will perform an action.

I want to turn that into a date value and update a separate date field each month with the correct date for that particular month. I have hit a wall so here I am asking for an assist :-).

I have played around with calculated date fields and the various workflow utilities and have not been able to accomplish much.

Any ideas?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi jenks540,

    It think it is a better idea to create a single date field and compare the date field to the current date on a regular basis. Then execute your logic when the date field exceeds the current date.

    I think it is important to point out that there are typically more than four weeks in a month, and there are other reasons why your text approach will create unnecessary complexity.

  • jenks540 Profile Picture
    45 on at

    Thanks for the reply.

    I am not seeing how I could make sure something is executed on say, "Wedensday of the third week of every month" with that method. Can you elaborate a little bit? Thank you!

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi jenk540,

    I was under the impression that you only wanted to execute the logic once.

    Consider executing your logic from a reoccurring SQL Server Agent Job instead of directly from Dynamics CRM. By customising a SQL Server Agent job, you can choose the particular days you want to run your logic.

  • jenks540 Profile Picture
    45 on at

    This is CRM online - so, no access to SQL Agent jobs

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi jenks540,

    You will still be able to make use of SQL Server Agent Jobs if you have SQL Server Management Studio (SSMS) and SQL Server Integration Services (SSIS).

  • jenks540 Profile Picture
    45 on at

    Yes, of course. But, will go there as a last resort. Would prefer to keep this in CRM if possible. Thanks

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    I don't think you will be able to get anything out of box or any utility to achieve this. You will need to write your own custom code (plugin/ JavaScript etc) to get the date out of this.  

    Hope this helps.

  • jenks540 Profile Picture
    45 on at

    I think you are right. I would not mind changing things slightly to "third Wednesday of the month" but i still don't think I can achieve without custom code. I was hoping I was missing something with the various workflow utilities.

    thanks to you both.

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Yes, let us know if you go for plugin and needs any help.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans