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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Trying to add a toggle to the accounts form, that when selected as "Yes", turns on a visible counter that counts up

(0) ShareShare
ReportReport
Posted on by 42

Hello,

I am trying to do something that I keep running into walls over. I've created a new field on the "Accounts" form called "Am I late?" and it is a toggle switch with "Yes" or "No' options. What I would like is to have a time beside it, under it, on top of it, called "I am late by", which displays the total time since that "Am I late?" toggle was turned on. Is there anyway to:

1) Create such a timer

2) Link it to the "yes" option of the "Am I late" field?

I have the same question (0)
  • Suggested answer
    Deekshitha Reddy Profile Picture
    219 on at

    I didn't get you, try referring to below image.

    time1 is the  time when you set the togggle true& time2 is the time when you open the page.

    pastedimage1682598231118v1.png

    Hope this helps.

    Thankyou

  • DevOs Profile Picture
    42 on at

    Hello Deekshitha,

    Thank you for replying. Am I supposed to use this within the formula option for a new field on the form?

  • Suggested answer
    Deekshitha Reddy Profile Picture
    219 on at

    Yes, It is possible. I coded on card page.

    field(AmILate; Rec.AmILate)//AmILate is of type Boolean

                   {

                       trigger OnValidate()

                       begin

                           IF AmILate= true then

                               Rec.time1 := Time;

                       end;

                   }

    trigger OnOpenPage()// Checks when the page opens

       begin

           if Rec.AmILate = true then begin

               Rec.time2 := time;

               Rec.Duration := Rec.time2 - Rec.time1;

               Rec.Modify();

           end;

    // Here time1 and time2 are fields of type time, Duration is a field of time duration.

    Please Let me know.

    Hope this Helps.

    Thankyou.

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

News and Announcements

Season of Giving Solutions is Here!

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 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 66

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 51 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 40 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans