OnInsertRecord and OnModifyRecord
Is it deliberate that the OnInsertRecord and OnModifyRecord triggers is not working on pages? OnInsertRecord results in a message saying that the view is filtered and the record is outside the filter. (Even though there are no filters set on the page..)
OnModifyRecord simply causes that you are unable to modify the record..
Can you give an example of AL code that causes these issues? The triggers on pages should work exactly the same as before
No code actually..
trigger OnInsertRecord(BelowxRec : Boolean) : Boolean; begin
end;
trigger OnModifyRecord() : Boolean; begin
end;
Just the triggers it seems..
Have you tried returning true from the triggers? Returning default/false means you're telling the system not to modify or insert any records. See the documentation on MSDN: https://msdn.microsoft.com/en-us/library/dd301145(v=nav.90).aspx https://msdn.microsoft.com/en-us/library/dd338973(v=nav.90).aspx
I'm having the same issues
simple table
table 50115 "Trigger Test" {
fields {
field(1; "Code"; Code[10]) {}
}
keys {
key("Primary Key"; Code) {}
}
trigger OnInsert();
begin
message('bar');
end;
}
simple page
page 50115 "Trigger Test" {
SourceTable = "Trigger Test";
PageType = List;
layout {
area(Content) {
repeater("General") {
field("Entry No.";Code) {}
}
}
}
trigger OnInsertRecord(BelowxRec : Boolean) : Boolean;
begin
message('foo');
end;
}
As soon as there is an OnInsertRecord trigger on the page, i receive the message the record is outside of the filter, and my OnInsert trigger from the table is not executed.
@StanislawStempin An "exit(true)" in the OnInsertTrigger does indeed prevent at least the error message, but the table trigger is still not executed!
Thanks for providing the repro. We will look into it.