Disable a particular dimension for a particular user group

rashi.kaushik
Member Posts: 52
Hi all,
Is there a way in Axapta by which i can disable a particular dimension(say CostCenter) from all the forms for a particular user group.
Thanx in advance
Is there a way in Axapta by which i can disable a particular dimension(say CostCenter) from all the forms for a particular user group.
Thanx in advance
0
Comments
-
Yep, you can do that by updating the SysSetupFormRun.init() method to look like below:
FormDataSource f; FormDataObject o; int i; DictField df; ; super(); SysSecurityFormSetup::loadSecurity(this); if (curuserid()=="Admin") { for (i=1;i<=this.dataSourceCount();i++) { f = this.dataSource(i); df = new DictField(f.cursor().TableId,fieldid2ext(fieldname2id(f.cursor().TableId,"Dimension"),2)); if (df) { o = f.object(df.id()); o.allowEdit(false); } } }
Yet, I didn't researched how you can find if the current user belong to a certain group. If you'd knew that, the code can be used directly for a group rather than for individual users like I did. A hint to research that: MainMenu\Administration\Users\Groups tab , see the code for populating the Selected groups listKind regards,
Ciprian Dudau
Axapta Developer0 -
Thanx Mugur,
Its working fine now.
Thanx a lot
Rashi0 -
To Mugur -
>>Yet, I didn't researched how you can find if the current user belong to >>a certain group
Here is an example -
Let us say you have created a user group under Accounts Receivable -> Parameters. Let us call this group - 'SalesAdmn'
So in your code you can check like this -select userGroupList where userGroupList.userId == curUserID() && userGroupList.groupId == SalesParameters::find().SalesAdmn; if (userGroupList) { ...... }
Hope this helps,
Harish MohanbabuHarish Mohanbabu
Long way to go before I sleep..0 -
Hi Harish,
That's what I was talking about.
Thanks for the solution.Kind regards,
Ciprian Dudau
Axapta Developer0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions