Hello Martin,
This is what ,I am doing…
Actually I am creating one sales order inside that in the line part I left one field,to get error and to track this error;I putted the break point in ‘info’ class -add method and i got stack trace error, below is the screen shot of my stack trace error ; where i got that From the InventonHandQty class checkitemdraw method I am getting this error.
Now, I want this error(That is verifed with the label code for the same error) to capture and save in one table’s string field. For that I wrote this code to save in table’s field:[tableForError is my table buffer and GotError is my field(str-data type)]
ttsBegin;
tableForError.GotError = strFmt("%1","@SYS2176");
tableForError.insert();
ttsCommit;
Stack Trace Error:-
Here, I putted the code to save the error in table’s field:(inventonHandQty-class, checkItemDraw-method)
public boolean checkItemDraw(
InventQty _inventQty,
NoYes _negativePhysical,
boolean _addInfo = true,
PdsCWInventQty _cwQty = 0
)
{
InventSumDelta inventSumDelta;
InventQty availPhysPost;
InventQty availPhysDelta;
str inventDimCriteriaPrefix;
Error_JJ errorjjj;
TableForError tableForError;//
str Error;
PdsCWInventQty cwAvailPhysPost;
PdsCWInventQty cwAvailPhysDelta;
if (! _negativePhysical)
{
// If WHS item, perform different check
if (itemUsesWHS)
{
return this.whsCheckItemDraw(_inventQty, _addInfo);
}
if
(!cwItem && (this.availPhysical() < (-_inventQty))
|| (cwItem && (this.pdsCWAvailPhysical() < -_cwQty)))
{
if (! _addInfo)
{
return false;
}
setPrefix("@SYS70390");
inventDimCriteriaPrefix = inventDimCriteria.preFix();
if (inventDimCriteriaPrefix)
{
setPrefix(inventDimCriteriaPrefix);
}
if (!appl.inventUpdateOnhandGlobal().inventUpdateOnhand().isFinalCommit())
{
if (cwItem)
{
return checkFailed(strFmt("@PDS87", -_cwQty, this.pdsCWAvailPhysical()));
}
ttsBegin;
tableForError.GotError = strFmt("%1","@SYS2176");
tableForError.insert();
ttsCommit;
return checkFailed(strFmt("@SYS2176", -_inventQty,this.availPhysical()));
}
else
{
availPhysPost = this.availPhysical();
if (cwItem)
{
cwAvailPhysPost = this.pdsCWAvailPhysical();
}
inventSumDelta = this.findSumJoinDelta();
inventSum.clear();
inventSum.addInventSumDeltaQty(inventSumDelta);
inventSum.addInventSumDeltaValues(inventSumDelta);
availPhysDelta = this.availPhysical();
if (cwItem)
{
cwAvailPhysDelta = this.pdsCWAvailPhysical();
return checkFailed(strFmt("@PDS87", -cwAvailPhysDelta, cwAvailPhysPost-cwAvailPhysDelta));
}
return checkFailed(strFmt("@SYS2176",-availPhysDelta,availPhysPost-availPhysDelta));
}
}
}
return true;
}
So, Overall its compiling successfully; But its not inserting in the table field ie. error message. where I am doing wrong or whether it is good way or not.Please guide me.
Thanks
Mani.