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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Creating a Count to Zero Field

(0) ShareShare
ReportReport
Posted on by

I am trying to create a field that would show the number of days until X event. Specifically, I'm trying to measure how many days I have left to pay an invoice before the date to get any invoice discounts for early payment has passed. So, if I have three days until the discount due date, the field should show "3". If today is the discount due date, the field should be "0". If the discount due date has already passed, I'd like the field to say "Exp".

I've gotten the field to calculate the countdown by doing a DiffInDays calculation. I am having trouble getting the field to show the values as described above. I thought about creating a separate field and writing workflows to set the values, but didn't know if there was an easier way.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Creating a Count to Zero Field

    Hello,

    You can't have "Exp" for whole number field. You will have to either change your requirements or don't use calculated whole number field.

  • David Jennaway Profile Picture
    14,065 on at
    RE: Creating a Count to Zero Field

    One option would be to keep the calculated whole number field (which you can use for filtering or sorting), and have a calculated text field that displays either the number of days (if >= 0), or 'Exp', and display the text field

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Creating a Count to Zero Field

    I think the way you thought is the  easiest way to create new field .

  • Community Member Profile Picture
    on at
    RE: Creating a Count to Zero Field

    Thanks for the feedback, guys! I ended up doing it the way that I'd originally planned. Works great.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Creating a Count to Zero Field

    Can you please share how you forced whole number calculated field to show "Exp"?

  • Community Member Profile Picture
    on at
    RE: Creating a Count to Zero Field

    I didn't. I just counted to zero and any day after the expiration date was a zero.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans