[SalesForce] How to get the Profile name form the userinfo

  1. I have integrated with the .net and I want the profile name from the login result. Is there any possible?

Question 2:

  1. When we query the opportunity record in c#, i want the modified user name. so how to get the modified user name.

Note: I got the modified-user id only. so how to get the username without query the user object.

Best Answer

Once you have a session you can call getUserInfo(). In the getUserInfoResult there is the profileID in the response.

Now that you have the profileId you can send a SOQL query off to Profile to get the Name field.

select id, name from profile where Id = '00e30000000hDW1AAM'

When performing a SOQL query against Opportunity you can get the last modified user name with LastModifiedBy.Name. E.g.

Select Id, Name, LastModifiedBy.Id, LastModifiedById, LastModifiedBy.Name From Opportunity