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.
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
{
ttsbegin;
// setting prodjournal table
// setting prodjournalprod table
prodJournalProd.insert();
ttscommit;
}
catch
{
ttsabort;
// i want to do something here
}
}
Edt: second statement added. and this catch working totaly fine.