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 :
Finance | Project Operations, Human Resources, ...
Answered

How to get the warning in try, catch

(1) ShareShare
ReportReport
Posted on by 230
Hi Team,
 
I am following the below link code.
 
In case if there are any error or warning i want loop should go in catch.
 
Currently in journalCheckPost.runOperation(); i am getting some warning message and loop is running for next record. 
 
And i want if there are any warning message loop should go into catch instead of going next record.
 
Regards,
Mohan
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    236,960 Most Valuable Professional on at
    How to get the warning in try, catch in D365FO
    Your descriptions sounds like that there is no unhandled exception to catch. Either there is no exception at all, or it's already handled. I guess that there really isn't any exception, just a warning message added to infolog.
     
    Start by looking at the place where the warning message is added to infolog and then look whether it's called from. If you find that it's a validation in runCheck(), you can simply use parmThrowCheckFailed() to instruct ProdJournalCheckPost to thrown an exception. Or you can look at the result (parmCheckJournalResult()) and break the loop, without having to deal with exceptions at all.
  • CU21091228-0 Profile Picture
    230 on at
    How to get the warning in try, catch
    Thanks Martin,
     
    It's resolved by using below code.
    JournalCheckPost.parmCheckJournalResult();
     

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 580 Most Valuable Professional

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 554

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans