Problem to fire OnInsert Table trigger on new record ListPart
On List part page, after completed the PK record data, the OnInsertRecord is fired. But the OnInsert Table is not fired. I need to insert the INSERT(true);
trigger OnInsertRecord(BelowxRec : Boolean) : Boolean; begin INSERT(true); //forced OnInsert Trigger manually end;
Hi @geraldbeaulieu877 ! We will look into this and see if it is a bug or just expected behavior.
This issue come when the trigger OnInsertRecord(BelowxRec : Boolean) : Boolean; is include in my page.
Can you provide are more complete repro/sample? Does this work when developed in C/SIDE?
Have you tried exit(true) after the insert?
Of course it's work well in C/SIDE. I converted my c/side code to al and i have this issue. So if I remove the OnInsertRecord Trigger from al, the code work well.
I couldn't deduct that from the small code snippet. The reason for asking is whether this is a change in the generated code or a platform issue. It helps us to find the problem faster.
I will investigate if the generated code has changed for OnInsertRecord trigger.
Hi @geraldbeaulieu877 and apologies for a delayed reply.
Could you please confirm if this is still an issue? If so, could you please provide:
- Version of the server and AL extension you are using
- Simple repro showing the problem
To help with the repro, I have tried the following extension code. A list page contains a list part with a repeater. When inserting an record in the list part, both OnInsertRecord and OnInsert are called. Does this repro work the same on your environment? If not, could you please modify the code to demonstrate the problem?
table 50100 CustomerHobby
{
fields
{
field(1; Hobby; Text[250])
{
}
}
keys
{
key(PK; Hobby)
{
Clustered = true;
}
}
trigger OnInsert()
begin
Message('Table OnInsert');
end;
}
page 50101 CustomerHobbyListPart
{
PageType = ListPart;
SourceTable = CustomerHobby;
layout
{
area(content)
{
group(GroupName)
{
repeater (ListPartRepeater)
{
field(Hobby; Hobby) {}
}
}
}
}
trigger OnInsertRecord(BelowxRec: Boolean): Boolean
begin
Message('OnInsertRecord');
end;
}
page 50100 CustomerList2
{
PageType = List;
SourceTable = Customer;
layout
{
area(Content)
{
part(HobbyList; CustomerHobbyListPart)
{
}
}
}
}
If you are still having this issue, then please open a new issue.