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...
Answered

multiple error in single message.

(1) ShareShare
ReportReport
Posted on by 90
I have created one action on which I am using multiple testfield. So when I click on action it is checking value one by one.But how I want is that it will check for all fields first then give an error that these fields should be filled in.I tried using error collection but issue is that there is constant message appear that" There are multipe error occur click on..... to see error". So instead of that I want to show error message directly for all blank field .Any idea how can I do this?
Thanks in Advance.
I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,347 Super User 2025 Season 2 on at
    Hi Salba, If you are unable to achieve it using Testfield you can use below logic.
     
  • Suggested answer
    Sivaguru Muralidharan Profile Picture
    33 on at
    Check out the "Collectible Errors" Section of this Blog.
     
    The core concept is to collect errors during a run and throwing all errors at once the run is complete.
  • Suggested answer
    VK-16090859-0 Profile Picture
    14 on at
    TESTFIELD raises an error and stops execution at first line, so you'll have to use a combination of manual checks and accumulate the error to achieve this actually something like this:
     
    _ErrorMsg := '';


    if Field1 = '' then
    _ErrorMsg := _ErrorMsg + 'Field 1 cannot be empty.\n';


    if Field2 = 0 then
    _ErrorMsg := _ErrorMsg + 'Field 2 cannt be zero.\n';
     
    And so on.....
    Rgds,
    VKS
  • Verified answer
    Khushbu Rajvi. Profile Picture
    20,347 Super User 2025 Season 2 on at
    Hi Salba, If you are unable to achieve it using Testfield you can use below logic.

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 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans