Check CRM user role

I need to do something that seems pretty easy and there is even some sample 
code in the SDK -- but I can't figure out how to read the results of the code.

"Retrieve the Roles for a User" sample code creates a collection object 
called "BusinessEntityCollection" but the sample code does not have any 
examples of reading the roles from the collection.  

I am not a C# expert and I am racking my brain try to figure this out.

Can someone please show me how to read the collection or tell me a better 
way to check if the user belongs to a specific CRM role?

Thank you!!



0
Utf
4/23/2007 11:30:01 PM
crm 35858 articles. 1 followers. Follow

3 Replies
588 Views

Similar Articles

[PageSpeed] 39

The last line in the sample is:

BusinessEntityCollection bec = service.RetrieveMultiple(qe);

To access the roles:

foreach(role r in bec.BusinessEntities) {
    //do your processing here
}


Please post developer questions to microsoft.public.crm.developer.

-- 
Michael H�hne, Microsoft Dynamics CRM MVP

Web: http://www.stunnware.com/crm2
Feed: http://www.stunnware.com/crm2/atom.aspx
Custom Lookup Dialog: http://www.stunnware.com/crm2/?area=customLookup

----------------------------------------------------------

"Teeg" <Teeg@discussions.microsoft.com> schrieb im Newsbeitrag 
news:3095D6C3-C470-4E1B-8588-9F533E392F74@microsoft.com...
>I need to do something that seems pretty easy and there is even some sample
> code in the SDK -- but I can't figure out how to read the results of the 
> code.
>
> "Retrieve the Roles for a User" sample code creates a collection object
> called "BusinessEntityCollection" but the sample code does not have any
> examples of reading the roles from the collection.
>
> I am not a C# expert and I am racking my brain try to figure this out.
>
> Can someone please show me how to read the collection or tell me a better
> way to check if the user belongs to a specific CRM role?
>
> Thank you!!
>
>
> 


0
Michael
4/24/2007 8:17:56 AM
Thank you!!!


"Michael Höhne" wrote:

> The last line in the sample is:
> 
> BusinessEntityCollection bec = service.RetrieveMultiple(qe);
> 
> To access the roles:
> 
> foreach(role r in bec.BusinessEntities) {
>     //do your processing here
> }
> 
> 
> Please post developer questions to microsoft.public.crm.developer.
> 
> -- 
> Michael Höhne, Microsoft Dynamics CRM MVP
> 
> Web: http://www.stunnware.com/crm2
> Feed: http://www.stunnware.com/crm2/atom.aspx
> Custom Lookup Dialog: http://www.stunnware.com/crm2/?area=customLookup
> 
> ----------------------------------------------------------
> 
> "Teeg" <Teeg@discussions.microsoft.com> schrieb im Newsbeitrag 
> news:3095D6C3-C470-4E1B-8588-9F533E392F74@microsoft.com...
> >I need to do something that seems pretty easy and there is even some sample
> > code in the SDK -- but I can't figure out how to read the results of the 
> > code.
> >
> > "Retrieve the Roles for a User" sample code creates a collection object
> > called "BusinessEntityCollection" but the sample code does not have any
> > examples of reading the roles from the collection.
> >
> > I am not a C# expert and I am racking my brain try to figure this out.
> >
> > Can someone please show me how to read the collection or tell me a better
> > way to check if the user belongs to a specific CRM role?
> >
> > Thank you!!
> >
> >
> > 
> 
> 
> 
0
Utf
4/24/2007 11:38:01 AM
Hey there Michael, how is it going?


"Michael Höhne" wrote:

> The last line in the sample is:
> 
> BusinessEntityCollection bec = service.RetrieveMultiple(qe);
> 
> To access the roles:
> 
> foreach(role r in bec.BusinessEntities) {
>     //do your processing here
> }
> 
> 
> Please post developer questions to microsoft.public.crm.developer.
> 
> -- 
> Michael Höhne, Microsoft Dynamics CRM MVP
> 
> Web: http://www.stunnware.com/crm2
> Feed: http://www.stunnware.com/crm2/atom.aspx
> Custom Lookup Dialog: http://www.stunnware.com/crm2/?area=customLookup
> 
> ----------------------------------------------------------
> 
> "Teeg" <Teeg@discussions.microsoft.com> schrieb im Newsbeitrag 
> news:3095D6C3-C470-4E1B-8588-9F533E392F74@microsoft.com...
> >I need to do something that seems pretty easy and there is even some sample
> > code in the SDK -- but I can't figure out how to read the results of the 
> > code.
> >
> > "Retrieve the Roles for a User" sample code creates a collection object
> > called "BusinessEntityCollection" but the sample code does not have any
> > examples of reading the roles from the collection.
> >
> > I am not a C# expert and I am racking my brain try to figure this out.
> >
> > Can someone please show me how to read the collection or tell me a better
> > way to check if the user belongs to a specific CRM role?
> >
> > Thank you!!
> >
> >
> > 
> 
> 
> 
0
Utf
4/26/2007 8:16:00 AM
Reply:

Similar Artilces:

CRM 3.0
Hi All, I am writing a custom report for CRM 3.0 to basically copy the My Activities view but display the regarding and To contacts and associated phone numbers. The report is basically done except for a few small issues. I would like to set up the Dynamic Drill-Through so when the person clicks on the Activity Subject it will open the associated Activity record. Unfortunately I have been unable to find the information needed to use in the following code to set the Object Type Code (OTC) to the correct activity type: = Parameters!CRM_URL.Value & "?ID={"&Fields!Activityid...

New user at Exchange 2003 cannot send mail to user at Exchange 5.5
I have 2 Exchange 5.5 and 1 Exchange 2003 in the same domain already, then I install one more Exchange 2003 in the child domain of the existing domain Then I create 1 user at child domain with mailbox in the new Exchange 2003. He find that he can only send mail to other whose mailbox in Exchange 2003. If recipient is in exchange 5.5, he cannot send to him. I have already set the ADC for the child domain. I also create the "recipient update service" for the child domain. Is any more setting needed to configurate ?? PS: In the Exchange 5.5 administrator, I can find the new user wi...

Telecheck and check verification
Can Telecheck be used through RMS somehow to verify checks? Pat The RMS check verification feature only works with PC Charge. I believe that some of the payment processing add-ins that have been discussed here in the past may enable Check Verification as well, but I'm not sure. -- -- Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.com ---------------------------------------------- Please DO NOT respond to me directly but post all responses here in the newsgroup so that all can share the information "Pat@arms" <Patarms@discussions.microso...

How to handle abnormal user disconnection condition from server?
I use MFC Visual C++ 4.2. I developed a simple network application to send message inter-clients and the number of clients also only a few persons ( about less than 10 persons ). I have succeeded in establishing server-client and client-server connection, sending and receiving messages from client. Now my problem are: 1. I need to send a message from a client to other client. How to know that the message I sent will be received by the correct user intended, not missed to other user? 2. How to handle the condition of unexpected user disconnection from server? E.g. : the user worksta...

Multiple user names at one bank or brokerage
I have 3 accounts at one bank. I have 3 corresponding accounts set up in MS Money 2007. One of them is setup for online banking while the other two are not. I now want to set the other two up for online banking but I can't find a way to specify the unique login info for each of the other two accounts. ...

instructions disppear when users begin type (text field)
Hi all, I need to customize the outlook contact form and I want to add one text field to allow users to add details info and instruct users how to add. Instructions shows in the field and the instructions disappear when users click and begin to type. How should I do this? exchange 2003/outlook2003 Thank you. It's hard for me to visualize exactly what you're expecting to happen. If you want the instructions to stay on the screen, you could display them in a label control. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumps...

Check Verification data is not saved into the database
A Check tender type has been created with the "Open" Check Verification. It seems to work OK except: 1) Although Driver's License, State and Birth Date are diaplyed on the form in POS the data entered is not saved into the Database. 2) The account Number is masked with X's. Can this be switched off anywhere? ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open th...

Alert user to check the filed when it is final
Hi, I want to create an alert to check the Final( checkbox ) field, if date_issued is enter. if date_issued is null then do nothing, In what even I have to code this and how? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1 mls via AccessMonster.com wrote: >Hi, I want to create an alert to check the Final( checkbox ) field, if >date_issued is enter. >if date_issued is null then do nothing, In what even I have to code this and >how? Based on just that one requirement, you can use the date text b...

spell check does not visually cycle through cells when run from macro?
I'm trying to recreate the same behavior in a macro that spellcheck has when the spellcheck button is pressed. The spellcheck does not cycle through the cells visually when run from a macro, so when there is a misspelled word, you cannot see the cell it is a part of. If anyone knows how I can get this behavior to work, it would be GREATLY appreciated. I did a record new macro, and got code similar to the following: Sub testSpelling() Range("F2:F500").Select Selection.CheckSpelling SpellLang:=1033 End Sub thanks, dan Dan, Add the fiollowing to your code as shown: ...

Failed CRM for Outlook Install
I am trying to install CRM for Outlook on a computer but it kleeps failing with the following error: "Setup has failed because of an error. Setup was unable to install the .msi file for Microsoft CRM Sales for Outlook" The user has Administative rights to the system, she has an account in CRM and a license. This is very frustrating since I have to clean up the registry every time I reinstall since it crashes before putting anything in the add remove control panel. Any ideas? -- Francois Try to uninstall MSDE and make sure you have all the databases removed. The default in...

viewing a user's email account
I have been charged with reviewing a user's email activity / mailbox for a possible impropriety. Is there a way to do this from exchange, or better yet what is the best way to accomplish this steathfuly? On Mon, 23 Oct 2006 18:20:02 -0700, Rossel1 <Rossel1@discussions.microsoft.com> wrote: >I have been charged with reviewing a user's email activity / mailbox for a >possible impropriety. Is there a way to do this from exchange, or better yet >what is the best way to accomplish this steathfuly? I really hope that the users' employment contract provides for this ...

Minimum Exchange 2003 for CRM 1.2?
Hello We are trying to setup a test deployment of CRM 1.2 for 5 users We (parent organisation) already has a email system (UNIX , pop, smtp) in place. I wish to learn what is the minimum Exchange setup that I need to do to deploy the test environment Is there a way to to configure the Exchange server such that it still uses the parent email system and still be used with the CRM thank you very much for your help vikrantca Hello, vikrantca wrote: > We are trying to setup a test deployment of CRM 1.2 for 5 users. > We (parent organisation) already has a email system (UNIX , pop, > smt...

Exchange fails to send CRM emails
When I try to send emails using the CRM 3.0 web interface "most" of them fail to be sent. If I copy that exact same and email and send it to the same address using outlook 2003 it sends with no problem. Exchange 2003 will send me an email, a day later that is is delayed and then finally another day later that it failed. I have turned off the email tracking in CRM and this did not help. I thought the numbers CRM puts in the subject may have been causing it to be blocked. What could be causing the emails to fail when sent using CRM and the exact same email to work with Outlook...

Making CRM more attractive in Outlook
Hi, I'm new to this site (and MS CRM). I am preparing a presales demo and want to make the outlook (desktop) version of CRM more attractive for users by using the shortcut buttons that CRM provides. I have two questions. One is more Outlook related, really. - Can I create a new view in the navigation pane (like mail, calendar, ...) with my CRM buttons? Right now I have all these buttons under "shortcuts" but that doesn't appeal to the user. - I have once seen a demo where a view was created with all the standard shortcut buttons in a sort of "folder list",...

switch users without closing program
Hi, Is there a way to switch profiles without closing Outlook 2002? Thanks, Duane ...

reconnect to mailbox after Disabling user?
Hello, I was wondering if there is a easier way then to recycle the Exchange Services to renable a mailbox after a users mailbox has been disabled for x amount of time. I want to give access to this mailbox to another user so right now.. I simply go to Mailbox Rights -> (add the user I want to add) -> give allow rights to Read / Full but this requires a recycle of the services. Is there another way without recycling the services? G. On Mon, 23 Aug 2004 11:08:36 -0400, "Just Another Admin" <just@dmin.net> wrote: >Hello, > >I was wondering if there ...

CRM Url
I initially installed the CRM server to the default url of the server (i.e. http://servername). I then installed SharePoint and it messed the configuration up. I then uninstalled SP. Now I can't get to the default server's url of http://servername. Any suggestions on how to correct? Go into IIS and setup a Host Header for the CRM site, Then add an alias for the Header to DNS. Calling the Alias will then resolve and access the site, -- Paul Papanek Stork MBA, CTT+, MCT, MCSE+I, MCSA, MCAD, MCDBA Solutient of Ohio, INC. email: pstork <<at>> att.net visit ME at: ...

I cannot uninstall CRM client for Outlook
We have two clinet machines that had CRM client for Outlook with Office 2003. We upgraded those workstations to Office 2007 and subsequently lost the ability to use the CRM features. When I try to uninstall the CLient, the uninstall asks for the disc and proceeds to reinstall the client until it realizes that the new version of outlook is incompatible. When trying the newer install disc for CRM, I get the following message: "The older version of Microsoft CRM desktop client cannot be removed. Contact your technical support group." This is followed by " Action Micro...

look way to map form at CRM frontend to tables at CRM database
How can I find out what tables which new record has been added on when I enter data through a form in CRM front end? I try to find way to map form in the CRM frontend to the tables at the CRM database at backend? It is CRM 3.0 Thank in advances for help! ...

Renaming Accounts in CRM
We are trying to change the account name in CRM, In the Account Name field when we chnage it, it goes through all cases and makes the owner of the case the person that changes the account name. Is there a way to have it not go back through all of the cases ? What you describe is not CRM functionality. Either you didn't describe it correctly, or there is some custom process performing the unwanted action I think you may mean when an account owner is changed, all the account's cases ownership also changes. Now that really is a pain!! "Rcw01" <rwilson01@gmail.com> w...

Cannot add user to CRM
I have trouble adding user to the CRM. I have 50 users in AD, however, when it comes to adding user in CRM, I can only choose from 15 of them. I wonder why!? I suppose I should be able to pick from all 50 users whoever is in the AD, right? If anyone have any clue on this problem and give me some feedback, I would surely appreciate that!!! CRM deployment manager will not display certain categories of users - eg if they have been migrated from NT domains or Novel NDS without passwords. Search the group archives for UserAccountControl "Martijn van Halen" <MartijnvanHalen@d...

Login problem to CRM 3.0
Hi, I installed CRM 3.0 Professional Edition without any error. I can login perfectly from the CRM server either using http://localhost:5555/ or http://appserver:5555/ under the crmadmin user. If I login to an XP workstation with the same user (crmadmin) and specify http://appserver:5555/ in IE6, I got a login window - where I enter the correct DOMAINNAME\crmadmin username and password - and got the following message: "You are not authorized to view this page"..."HTTP Error 401.1 - Unauthorized... I think the prolem is around IIS security, but what shoud be the next step. Th...

How to let OWA users to change their password ?
How to let OWA users to change their password ? On Wed, 9 Nov 2005 01:58:03 -0800, "Enid" <Enid@discussions.microsoft.com> wrote: >How to let OWA users to change their password ? There are quite a few steps but if you follow this: http://support.microsoft.com/default.aspx?scid=kb;en-us;297121 carefuly, you'll be ok. Thanks for your information. Follow the document to enable the change password funcation, but got error when using IE6 w/ SP2 to do change password "error number : 5". It is so tricky if using FireFox, the password change is work. Any suggesti...

Virus checking via double-clicking
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel At one time double clicking an Office file icon on the Mac by-passed virus checking. If I double click an Office file icon on my Mac, will Mac Office 2008 check for viruses automatically before opening the file for use by the Office application? On Tue, 2 Jun 2009 09:20:19 -0400, trying_to_work@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.5 (Leopard) > Processor: Intel > > At one time double clicking an Office file icon on the Mac by-passed virus > checking. If I double cli...

User authentication/protection
I'm a professor and use Excel extensively in my classes. I need to be able to assign Excel projects to my students and have some increased assurance that the students have submitted their own work. I've tried my hand at VBA programming and also simply used track changes. None of these solutions (even the track changes) worked reliably across both mac and pc platforms. I would like some advice about whether what I need from Excel is even possible. I Here's what I need and what I think would work: 1. I'd like to prevent a student from getting someone else's sol...