Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Multiply datetime x integer

Posted on by 688

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

  • RE: Multiply datetime x integer

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

  • Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Multiply datetime x integer

    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

  • RE: Multiply datetime x integer

    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.

  • Suggested answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Multiply datetime x integer

    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

  • RE: Multiply datetime x integer

    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

  • Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Multiply datetime x integer

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans