13
Hi Team,

It would be beneficial for the system to have the ability to override a certain trigger on a table or a page.
Also adding a priority would be useful.
I will write an example with an architecture of how the platform should handle this below, for one blunt event such as OnAssistEdit on a page field, but this should extend to all similar events:

pageextension 60000 "Extend Job Card" extends "Job Card"
{
layout
{
modify("No.")
{
trigger OnAssistEdit(60100,True)
begin
Message('CustomEvent');
end;
}
}
}

where all the triggers should have two new parameters:
1. OrderOfExecution - integer
OrderOfExecution would allow different extensions to set an order of execution.
The trick is that the OrderOfExecution should be validated against the App.json permitted range and should be part of that range.
I am open to comments and suggestions for this one, but the idea is that you can have extensions that would trigger in the order of their assigned object range so generally we would have some sort of order of execution between extensions.
For instance the custom range 50000-99999 would be executed after standard ones by default, but before published apps.

2. SkipStandardTrigger - boolean

SkipStandardTrigger = true: it should only execute triggers with a higher priority than 0
* base app trigger code in the system don't need to change by default should be considered (0,false) and always executed before all the other triggers unless there is an extension that calls SkipStandardTrigger = true.

3. (Optional) SkipCustomTrigger: Integer
This one is the nicest: if set, it will allow the current trigger to disable another one in a different extension.
However to use it you will need to be able to add the other one as a dependancy and obviously to know(if the vendor is willing to share it with you for a certain customer), or be able to see it's ID.


Please vote for the idea if you find it useful.

Cheers,
Robert Bulugea
Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future.

Best regards,
Business Central Team