Closed JulianTillmann closed 5 years ago
Hi @JulianTillmann, role centers in AL do not allow having triggers defined. When defining a new role center you would get the following diagnostics:
You would also get similar diagnostics when defining a trigger on page elements like in a field or an action.
It seems that we are missing some validation in page extensions that are targeting a page of type role center.
ok, we found out ourselves that Code in the RoleCenter-Triggers doesn't work in C/SIDE, but at least we get a Compiler error. Could you please see to that Validation in AL? Thanks in Advance
Also: how do you propose to solve this requirement? To dynamically set the visibility of a RoleCenter-Part?
We will fix the missing validation from page extensions.
I do not know if there is an alternative that you can use to dynamically set the visibility of a part in a RoleCenter. Did you try posting your question in one of the following forums? Business Central Community Mibuso forum Dynamics User Group
I'm sorry, but I thought this was the place to find the Solutions for cloud Ready extensions for Business Central?
We are not interested in workarounds but would like to have a solution to this requirement within the AL standard.
We will add to our backlog to investigate on the possibility to remove this restriction on role centers in future releases. We can use this issue to track it on Github.
We added validation for triggers defined in Role Centers in our master branch (targeting Fall 2019) as well as some better validation around Role Centers in page and page extensions. Concerning the ability to define trigger code in Role Centers, please consider logging it on https://aka.ms/BusinessCentralideas, or vote up the idea if its already there. We're constantly monitoring top Ideas and will consider them for a future release.
Describe the bug We tried adding a new Activities Part to a RoleCenter. This Activities-Cardpart should only be shown if certain data is set. So we added a Visible-Boolean-Variable in the RoleCenter-PageExtension, changed the Visible-Property in the Part and set the variable in the OnOpenPage-Trigger.
But the PagePart is shown regardless of any Code in the OnOpen Page.
So we added a message to the OnOpenPage(Extension)-Trigger, but nothing's Happening. Same with the OnAfterGetRecord.
I've attached the whole ALProject
ActivityPageVisibleTest.zip
Versions: