Options

Testcodeunits AL: TableLocks when sugessting Reminder Lines

Hello everybody.
As the title suggests, I have a problem with table locks during my small test application.

I have set up a test codeunit in BC16, which should enter a customer on the reminder page (Page434, Table295) and then suggest lines by the action "Suggest Reminder Lines". This is a process that works very well when I do it directly in the web client. The Code is:
codeunit 60001 "Test Codeunit"
{
    Subtype = Test;

    trigger OnRun()
    begin

    end;

    [Test]
    procedure TestOne()
    var
        Reminder: TestPage "Reminder";
    begin
        Reminder.OpenNew();
        Reminder."Customer No.".SetValue(CustomerNo); // Of course the variable "CustomerNo" is set in real test.
        Reminder.SuggestReminderLines.Invoke();
    end;
}

The Error Massage I am getting is:
xdwqccxlqddr.png

Here is the Code Snippet from the standard application where the error occurs. It is the onAction trigger of the Page 434 "Reminder".
pxkocj4t05tv.png

So my Question is: Where does this tablelock cames from? What is the difference between the code simulating the users actions and the process of doing it in the webclient directly. It seems like i am not allowed to run the report "Suggest Reminder Lines" with a request Page. But the standard action does that, so my test has to be able to handle it.
Thanks for your time!
Sign In or Register to comment.