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)

Multiply datetime x integer

(0) ShareShare
ReportReport
Posted on by 694

Hello everyone,

I need via javascript get a date field and multiply by an integer, and the result of this multiplication I need to set in another text field, pdoeria someone please help me?

Thank you

*This post is locked for comments

I have the same question (0)
  • Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    You can't multiple a date on its own (like, what's 4 * November 17th?) What part of the date do you need to multiply? What are you trying to do?

    Thanks,

    Aiden

  • Ricardo Rodrigues dos Santos Profile Picture
    694 on at

    Hello Aiden,


    Obriado unanswered. The scenario is the following, I have a field called date of the document and a field called days of validity, I need to multiply the document date * day of validity to set the Expiration Date field the result of this multiplication, you know?

    Thank you for your help

  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi Ricardo,

    Sorry if I still am not clear - it sounds like you want to add the validity to the document date, not multiply. So, 1/10/16 + 15 days, yes?

    If you want to do it no-code, you can handle this with a workflow if you download Workflow Elements at kaskela.wordpress.com. The workflow would be setup with:

    Trigger = create or (update of your record if one of those two fields change)

    Workflow steps:

    • Check (document date has a value and day of validity has a value)
      • Call the custom activity "Date – Add or Subtract" (link)
        • Input parameters are:
          • Date to Modify = Document Date
          • Unit = Days
          • Number = Validity
      • Update your record
        • Set Expiration Date = Modified Date output parameter from previous step

    Hope this helps! I'd be happy to answer any followup questions or clarify. I'd appreciate if you'd mark this as Answering your question.

    Thanks,

      Aiden

  • Ricardo Rodrigues dos Santos Profile Picture
    694 on at

    Hi,

    Yes, it would add the date entered by the user, plus the days of validity of the document and the result meets the Expiration Date field

    Tank You.

  • Aiden Kaskela Profile Picture
    19,696 on at

    Perfect - I'd go with the workflow solution because that'll happen however the record is created or updated, and the javascript will only run if the user is on the CRM form.

    Thanks!

     Aiden

  • Ricardo Rodrigues dos Santos Profile Picture
    694 on at

    Okay, I went up to your solution, will perform a test

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