web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Restrict the same Entry Points for two different Menus.

(0) ShareShare
ReportReport
Posted on by

Requirement -

Full access to Approved Vendors (Product information management\Common\Released product\Purchase\Approved vendor\Approved vendors

Design -

1. Create the AX security role for this. (Created Process Cycles | Privileges | Duties | Roles)

2. Drag and drop "PdsInventInquiryApprovedVendorListByItem" to the Entry Points

3. Change the AccessLevel Property level to the "Delete"

Result - 

1. Perfect, I got the Approved Vendors under the Product information management\Common\Released product\Purchase\Approved vendor

Issue-

"PdsInventInquiryApprovedVendorListByItem" activated secondary menus that I don't want to show. 

(Procurement & sourcing\ Inquiries\ Venders\ Approved vendor list by item)

Questions-

How could I restrict the access to Procurement & sourcing but not for the Product Information Management?

1. How will I do this without X++ code?

2. How will I do this with X++ codes?

 

Appreciate your help.

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Do you want the same role to have different access to this same menu on different paths. If it is not the same role, then you can create a new security privilege and include PdsInventInquiryApprovedVendorListByItem menuItem in it with effective access set to NoAccess and assign to the role where intended to provide no access.

  • Community Member Profile Picture
    on at

    Hi Chaitanya,

    This is for the same role;

    I can't change it to NoAccess since it will block the access in the Product Information management Menu.

  • Suggested answer
    Ajit Profile Picture
    8,788 on at

    You would have to create two separate privileges and assign to different roles.

  • Community Member Profile Picture
    on at

    Hi Ajit,

    I have only one role. This Entry point has to be in that role. but not both menus.

  • Ajit Profile Picture
    8,788 on at

    If we are using same menu item at both places\Modules then you might have to create a separate menu item and then you can restrict with same role.

  • Community Member Profile Picture
    on at

    Hi Ajit,

    Please explain a bit further.

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Please perform the following.

    In the init method of Form, PdsApprovedVendorList include the following code which restricts user
    if the user is present in the intended role and form is not called from ProductInformationManagement Menu.

    public void init()
    {
        // Code Added
        SecurityUserRole securityUserRole; 
        SecurityRole securityRole;
        // Code Added
        
        Args args = element.args();
    
        if (!args
            || (args.record()
                && args.record().TableId != tablenum(InventTable)
                && args.record().TableId != tablenum(VendTable)
                && args.record().TableId != tablenum(PurchTable)))
        {
            throw error("@PRO467");
        }
    
        // Code Added
        select AotName from securityRole           
            where securityRole.AotName == "RoleName"
            join securityUserRole
            where securityUserRole.User == curUserId()
            && securityUserRole.SecurityRole == securityRole.RecId;
        
        if (securityRole.RecId)
        {
            if (!(args.caller() && args.caller().name() == formStr(EcoResProductPerCompanyListPage)))
            {
                 throw error("User has no access");       
            }
        }
        // Code Added
        
        pdsFormCtrl = PdsFormCtrl_PdsApprovedVendorList::newFromMenuItem(args.menuItemName(), element);
    
        pdsFormCtrl.initPre();
    
        super();
    
        dateEffectivenessFormController = DateEffectivenessFormController::newFormControls(PdsApprovedVendorList_ds,
                                                                                DateEffectivenessText,
                                                                                ButtonViewAll,
                                                                                ButtonViewCurrent,
                                                                                RemoveRecord,
                                                                                EditRecord);
    
        dateEffectivenessFormController.setViewState(DateEffectivenessViewState::All);
    
        pdsFormCtrl.initPost();        
    }
    

  • Community Member Profile Picture
    on at

    Thank you for your great help. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans