codeunit 60001 "Test Codeunit" { Subtype = Test; trigger OnRun() begin end; [Test] procedure TestOne() var SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; SalesOrder: TestPage "Sales Order"; begin // Create a Sales Order with "External Document No", and set the "Due Date" to the past (-10) SalesHeader.Init(); SalesHeader.Validate("Document Type", SalesHeader."Document Type"::Order); SalesHeader.Validate("Sell-to Customer No.", '01121212'); SalesHeader.Validate("Due Date", Workdate() - 10); SalesHeader.Validate("External Document No.", '123'); SalesHeader.Insert(true); // Create 2 Corresponding random Sales Lines CreateSalesLine(SalesHeader, SalesLine.Type::Item); CreateSalesLine(SalesHeader, SalesLine.Type::Item); // Goto to the Corresponding Sales Order Page and post that stuff. SalesOrder.OpenEdit(); SalesOrder.GoToKey(SalesHeader."Document Type", SalesHeader."No."); SalesOrder.Post.Invoke(); end; }
SalesOrder.Release.Invoke(); SalesOrder.Post.Invoke();And see if there is a difference.
Answers
I'm also not sure, why you get this error message.
But I would try to change the code like that:
And see if there is a difference.
But I am still amazed. As a user, I can also post without realsing before. Why do I have to do this explicitly in my test? Seems strange.
Nerver the less, thanks for help.