Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

How to get the warning in try, catch

(1) ShareShare
ReportReport
Posted on by 171
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
  • CU21091228-0 Profile Picture
    CU21091228-0 171 on at
    How to get the warning in try, catch
    Thanks Martin,
     
    It's resolved by using below code.
    JournalCheckPost.parmCheckJournalResult();
     
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,934 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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,111 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,934 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans