procedure IsSalesInvoiceDocumentDateWorkday() var SalesHeader: Record "Sales Header" temporary; SalesInvoice: TestPage "Sales Invoice"; begin //Create a dummy record with a document date that is different than the WORKDATE SalesHeader.Init(); SalesHeader.Insert(true); SalesHeader."Document Date" := CalcDate('<1D>', WorkDate()); SalesHeader.Modify(); SalesInvoice.OpenEdit(); SalesInvoice.F_DocumentDate.AssertEquals(WorkDate());
Answers
Or GoToKey:
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/testpage/testpage-gotokey-method