Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

X++ Catch does not catch the error

$
0
0

Hey,

i am kind a new on development D365 Fo i faced problem about try catch statement which is not exception not catched by catch.

When i trying to insert my customProd method throws error. I am expecting this insert error should be catched by statement .

When i trying to debug i can see  "inventory dimensions site must be consistent within the lot" error on infolog.

public void customProd(List _myList)
{
    MyClass myClass;
    literator = new ListIterator(_myList.parmTamamlandi());
    while(literator.more())
    {
        myClass = literator.value();
        ttsbegin;
        if(!this.prodStart(myClass))
        {
            ttsabort;
            literator.next();
            continue;
        }
        if(!this.finished(myClass))
        {
            ttsabrot;
            literator.next();
            continue;
        }
        ttscommit;
    }
}

public boolean finished(MyClass _myClass)
{
    try
    {
        // setting prodjournal table
        
        // setting prodjournalprod table
        
        prodJournalProd.insert(); 
        
    }
    catch
    {
        // i want to do something here 
    }
}

otherhand when i remove tts statement from customProd method and put them into finished method its working fine.

Is there anything i am missing ? what should i do for catch the error on first statement.


Viewing all articles
Browse latest Browse all 72043

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>