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 :
Small and medium business | Business Central, N...
Suggested Answer

Selected date field value lost when clicking OK without previously losing focus

(0) ShareShare
ReportReport
Posted on by 50

Hello,

We are facing a problem if just after selecting a date we press the OK button of the page without previously losing the focus from the date field. In this case, the OnValidate trigger of the date field never fires, and we lose the selected date, using the old one in the action triggered by the OK button.

2020_2D00_07_2D00_14_5F00_11h36_5F00_22.png

Is there any way to validate the field value just after selecting the date and without losing the focus? 

Please note that, "Due date" field is part of a ListPart included into a WorkSheet page.

Thanks in advance for any suggestions.

--

Belén

I have the same question (0)
  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    Hi,

    Check if the DelayedInsert is set on the Page.

    Regards

    Avinash B

  • BelenSA Profile Picture
    50 on at

    Thanks for the idea. However, DelayedInsert is not set.

    We are working with temporary records in the listpart, by setting SourceTableTemporary = true. Could the issue be related to this?

  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    Yes. this is the reason you lose the data after clicking on OK button.

    And once you select the Due Date, press tab button which will trigger the OnValidate trigger.

  • BelenSA Profile Picture
    50 on at

    Yes, the solution is to lose the focus (pressing tab or clicking anywhere else outside the field) before clicking OK button. However, we can not assume that users will do that before clicking OK.

    We were thinking about a workaround to solve it since with text fields is not happening the same as with the date field. If after writing in a text field, we press OK without previously changing the field focus, the text is not lost. Could it be anything related to date fields not validating the value after date is chosen in the date picker?

  • Suggested answer
    Avinash B Profile Picture
    1,455 on at

    The field will be validated on clicking OK button if you have not pressed the tab button.

  • BelenSA Profile Picture
    50 on at

    The thing is that when pressing OK, OnQueryClosePage trigger fires to execute the OK action and no validation has happened in the date field. The logic in OK needs the new valuie of the date field but on the contrary, since it has not been validated, it processes the old value. Then page closes.

  • Zaahed Profile Picture
    5 on at

    Hi Belen, I seem to have come across the same issue. When a date is selected from a Date field on the page and the immediate next action is a drill down on another field, the new value from the date-picker is not yet validated into the date field The Date field still has an old value. Have you managed to find a workaround for this? or do you still experience the issue

  • BelenSA Profile Picture
    50 on at

    Hello Zaahed. I'm afraid we haven't found a work around for this yet. Also I just checked it in a 18.3 BC version and the issue is still happening.

    I hope you find a way to solve it and you can share it with us.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans