Insert a Warning Message into a Table..

Hi all,

In the creation of sales order,I filled the Quantity and Discount fields in the SalesLine without giving Unit Price.

that time One Warning message Popped up “The Sign on Quantity and NetAmount to be the Same”.(@SYS78848)

This Warning Came from Class “SalesLineType.ValidateWrite”.(I found out through Debugging).

Now I have written a code in that class to insert that Warning Message into my table(tableerror).But i am not able to insert it,It Shows Stack trace Error.

My Code:

if (salesLine.SalesQty * salesLine.LineAmount < 0)

{

ok = checkFailed("@SYS78848");

ttsBegin;

tableerror.UserName = curUserId();
tableerror.CatchError= “@SYS78848”;

tableerror.insert();

ttsCommit;

}

Please Guide me ,

Thanks and Regards,

Jacob.A

Please tell us more about the error. Solving an unknown error is very difficult…

Also, please use Insert > Insert code to paste source code. It preserves indentation, making code more readable.

if (salesLine.SalesQty * salesLine.LineAmount < 0)
{
    ok = checkFailed("@SYS78848");

    ttsBegin;

    tableerror.UserName = curUserId();
    tableerror.CatchError= "@SYS78848";

    tableerror.insert();

    ttsCommit;
}

Thanks, Martin.

I have attached the Screenshot of the Stack Trace Error.

Thanks,

Jacob.A

How is the error related the the code you showed us? In which method do you call your logic?

Also note that you can use the debugger to see what’s going on.