Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Create field with functionality

Posted on by 159

Hello,

I would like create a  new numerical field called “Odometer Reading”.

If function so that mileage cannot be less than or the same as previously recorded odometer value.

What would be the best way to implement this requirement ?

Thanks.

  • Kahspot Profile Picture
    Kahspot 159 on at
    RE: Create field with functionality

    Thanks.

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 21,009 Super User 2024 Season 2 on at
    RE: Create field with functionality

    Hi Kahspot,

    This is one method of implementing this functionality.

    1. Create a Whole Number field called "Odometer Reading", and a Whole Number field called "Previous Odometer Value" with a default value of 0.
    2. Place the "Odometer Reading" field on a form.
    3. Create a JavaScript file that runs On Change of the "Odometer Reading" field. If the new value for the "Odometer Reading" field is less than or equal to the value in the "Previous Odometer Value" field, then throw an error. If the new value for the "Odometer Reading" field is greater than the value in the "Previous Odometer Value" field, set the "Previous Odometer Value" field to the same value as the new value for the "Odometer Reading" field.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans