Options

TestPages - Create Customer with OpenNew

markclemarkcle Member Posts: 65
Hi All

I'm writing and AL extension (on-prem). I'm trying to create a customer (for now I want it committed, so I set test isolation to "Disabled")

I'm calling the following from an action button. My No series is set for Default and Manual nos is disabled

codeunit 50006 ClesenTestRunnerCodeUnit
{
    Subtype = TestRunner;
    TestIsolation = Disabled;

    trigger OnRun()
    begin
        ClesenTestPageCodeUnit.Run();
    end;

    var
        ClesenTestPageCodeUnit: codeunit ClesenTestPageCodeUnit;
}
codeunit 50000 ClesenTestPageCodeUnit
{
     Subtype = Test;

    [Test]
    procedure TestCustCard()
    var
        CustCard: TestPage "Customer Card";
    begin
        CustCard.OpenNew();
        with CustCard do begin
             Name.SetValue('Mark Test Co2');
             OK.Invoke();
        end;
    end;
}


When I run the test I get the following error:

49ora3jgfp4q.png

If I turn on Manual numbers in the No Series and set a Cust No, it works fine

Anyone know what I'm doing wrong?

Thanks

Mark

Sign In or Register to comment.