Hi All
We're and end user developing some of our own extensions, so we can't use the test tool or test libraries. I need to write tests that insert lines (which will update other items based on an event subscription)
I got as far as opening the sales order in edit mode (hard-coding the sales order no for now), but I'm stuck on how to create a line item. Could anyone point me in the right direction. Here's my proc:
[Test]
procedure TestSalesOrderline()
var
SalesOrderCard: TestPage "Sales Order";
begin
SalesOrderCard.OpenEdit();
with SalesOrderCard do begin
GoToKey(1, 'S200020');
"No.".AssertEquals('S200020');
// Insert a line with item no 'FLOC'
OK.Invoke();
end;
end;
How would I go about inserting a sales line in this order and then getting the value form one of it's fields?
Thanks
Mark
Answers
Can you insert your lines on table level?
I am somewhat puzzled by OnAfterInsite, it triggers twice for every line when I just open a sales order in edit mode. No new lines have been inserted at all, but it still fires twice
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
It triggers several times because to calculate the totals, the Page inserts into (temporary) Sales Line table. To avoid that, the first thing your event should check, is if the record is "real" or temporary to avoid such situations.