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)

condition for buisness rule

(0) ShareShare
ReportReport
Posted on by 5,514

how the condition will be for business hour took to complete task by seeing two fields start time and end time

*This post is locked for comments

I have the same question (0)
  • sandeepc Profile Picture
    5,514 on at

    i wrote a javascript but in crm 2011 calculated fields are not there so its not calculating autmoaticaly so

  • Suggested answer
    Community Member Profile Picture
    on at

    EDIT: Sorry, I did not see CRM 2011.

    For CRM 2011, you will have to use javascript. Put it onChange of startdate/enddate. Something from here should be applicable for your needs:
    http://stackoverflow.com/questions/19225414/how-to-get-the-hours-difference-between-two-date-objects

    Old answer:

    If start time is 2016-08-10:10:00, and end time is 2016-08-10:12:00, you want to set a field ("Hours taken to complete task") to 2 hours, correct?

    I don't believe you can use Business Rules for this. Instead, use calculated field.

    Create a Whole Number field, Calculated.

    Use DIFFINHOURS between Start Date and End Date.

    technet.microsoft.com/.../dn832103.aspx

    See example "Days from a record creation", replace "createdon" and "Now()" with the field names you want; for instance "startdate" and "enddate".

  • sandeepc Profile Picture
    5,514 on at

    yes what you said is correct , but there is no calculated option when we create whole number field..

  • sandeepc Profile Picture
    5,514 on at

    shall i add decimal number and try?

  • sandeepc Profile Picture
    5,514 on at

    not working at all... frustrated for the same

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