Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

Posted on by 920

I have a specific module that generates roles.

I generate new role that has access to Accounting payable> journal> invoice journal and I assign it to user1.

I login with this user.

When I clicked on button validate I have this error message:"Access denied to method TRANSFER of class LedgerPostingGeneralJournalController"

When I verify the menuItem called by this button "LedgerJourPost" in menuItems > Action:

7331.menuItem.png

its normal to have menuItem without declaring the object?

*This post is locked for comments

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    Why you're trying to create something new to setup the security role instead of using Security Development Tool ?

  • BASMA Profile Picture
    BASMA 920 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    but I want to add it with code .

    the same case for the method transfer of ledgerPostingGeneralJournalController class, I added it but I have message error

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    First of all the method should be in the  Privilege -> Permissions -> Server Methods node.

    The addition the SalesFormLetter_InvoiceMaintain privilege to role will be enough and you don't need to add any method.

  • BASMA Profile Picture
    BASMA 920 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    Hi Rustem,

    I try your suggestion the meyhod is added to my privilege but I get the same error.

    I added manually the privilege "SalesFormLetter_InvoiceMaintain" to my role I don't have error.

    8463.privilege.png

    I should add these methods to my privilege?

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    Hi BASMA!

    Here is example:

    static void garu_addServerMethodOnPrivelege(Args _args)
    {
        #AOT
        TreeNode    treeNodePrivilege;
        TreeNode    treeNodeMethod;
        treeNode    treeServerMethod;
        str         privilageName = "yourPrivelege";
        str         treeNodeName  = strFmt("%1\\%2\\Permissions\\Server Methods", #SecPrivilegesPath, privilageName);
        str         methodName    = "run";
        str         className     = "SalesFormletter_invoice";
        str         newProp;
        
        
    
        treeNodePrivilege = TreeNode::findNode(#SecPrivilegesPath + "\\" + privilageName);
        treeNodeMethod    = TreeNode::findNode(treeNodeName);
        
        treeNodeMethod.AOTadd(methodName);
        
        treeServerMethod  = TreeNode::findNode(treeNodeName + "\\" + methodName);
        newProp           = treeServerMethod.AOTgetProperties();
    
        if (treeServerMethod)
        {
    
            newProp = setProperty(newProp,'Class', className);
            newProp = setProperty(newProp,'Method', methodName);
            
            treeServerMethod.AOTsetProperties(newProp);
            treeServerMethod.AOTsave();
        }
        
        treeNodePrivilege.AOTsave();
        
        info("done");
     }

  • BASMA Profile Picture
    BASMA 920 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    Yes,

    its the same case to : Access denied:SalesFormletter_invoice

     

  • Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    Hi BASMA!

    You want to add the server methods to privilege through x++ ?

  • BASMA Profile Picture
    BASMA 920 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    Hi Rustem,Thanks for your reply.

    I follow the suggestion in the link.when I add this method to role I don't have error message.

    but when I generate another role I get the same issue,so I need something dynamic means : when I generate new role that has access to Accounting payable> journal> invoice journal I don't get error message.

  • Suggested answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    Check this link: https://community.dynamics.com/ax/f/33/t/97334

  • BASMA Profile Picture
    BASMA 920 on at
    RE: Access denied to method TRANSFER of class LedgerPostingGeneralJournalController

    but I don't understand the source of this error message

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans