Hello All,
I am using a standard class in my code but this class need System admin role to use it, if you don't have System admin the method will jump to the "catch" statement and give you the error written there . The class name "DocuTemplateRender" method renderTemplateToStream ,so my question how I can add this class and method to a security role in D365 FF&O.
Any help would be appreciated
Thanks
Maen.M
I can't be considered an expert when it comes to security, but if I'm not mistaken, you can't add classes to privilage in 365. You should be able to add your Class's menuItem.
Hi,
you can add your method on aot, navigate to AOT node at Security > Privileges > YourPrivilege > Permissions > Server Methods > YourServerMethod.,
Best Regards.
Hi Ergün Şahin,
You mean add the class to a menuitem then add it the privilege, because this class don't have menuitem.
Hi Osman Akgündüz ,
this can be done in AX2012 I'm using D365 FF&O there is no server methods in it
Did you try to add it as a reference to the security key?
I don't think the error was caused by the Class itself. Can you share the error?
If I remember correctly, many of the methods of this class were using the DocuTemplate table. The error may be caused by this table.
As Ergun mentioned you must add your class to an action menu item then add to the key on the above screen.
Hi Ma'en Moutaz,
As Osman mentioned, you must create an action menu item for the class than add that menu item to the privileges
and than add that privilege to the desired role.
Regards,
Atul Yadav
dynamicscommunity101.blogspot.com
Dear Osman Akgündüz and Ergün Şahin
I have tried the service operation with no luck
and i have tried to add the class to actionmenu item but i got error on build that this class doesn't contain "Main" method
Also i have tried adding the DocuTemplate table to the privilege no luck .
Ergün the error is from the catch in my method.
Since it is not called from the Class menuItem, there is no logic to make a new menuItem.
As I have already written, I don't think the issue is about the security of the class. These classes contain many structures that will require authorization. It is difficult to say anything for sure, because you do not share the error you received, and the codes you received the error.
If the error seems meaningless, you can check it with Debug or check why it fell into catch in the code.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
We are honored to recognize Mansi Soni as our August 2025 Community…
A new season of Super Users has arrived, and we are so grateful for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.