Announcements
This question probably has an obvious answer but it eludes me, so I'd appreciate help...
With only (2?) available triggers at the (table) field level (each of which require user intervention), how can I do the following in a simple way using Trigger Events?
Let's call 4 fields A, B, C, & D.
Thanks in advance.
ZHU, Thank you for your suggestion.
I will try this today, then reply afterward.
Hi, Can you try the following?
tableextension 50100 MyExtension extends item { fields { field(50000; A; Code[20]) { DataClassification = CustomerContent; } field(50001; B; Code[20]) { DataClassification = CustomerContent; } field(50002; C; Code[20]) { DataClassification = CustomerContent; } field(50003; D; Code[20]) { DataClassification = CustomerContent; } } } codeunit 50100 MyCodeunit { [EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterValidateEvent', 'A', false, false)] local procedure MyProcedureA(var Rec: Record Item; var xRec: Record Item) begin Rec.Validate(B, 'Test'); end; [EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterValidateEvent', 'B', false, false)] local procedure MyProcedureB(var Rec: Record Item; var xRec: Record Item) begin if Rec.B <> xRec.B then Rec.Validate(C, 'Test2'); end; [EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterValidateEvent', 'C', false, false)] local procedure MyProcedureC(var Rec: Record Item; var xRec: Record Item) begin if Rec.C <> xRec.C then Rec.Validate(D, 'Test3'); end; }
Hope this will help.
Thanks.
ZHU
Update... This now works using OnModify Table Trigger Event so that the calculations work just before page is closed.
If anyone has a more efficient way, please do share. thx
André Arnaud de Cal...
294,002
Super User 2025 Season 1
Martin Dráb
232,852
Most Valuable Professional
nmaenpaa
101,158
Moderator