function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ttrieuttrieu 

querying for Profile Name

Hi,

  I'm trying to retrieve "Standard User" from the Name field of the Profile object with the following query: "select Id, Name from Profile where Name = Standard User"  but that always complains about a malformed query. 

  So I tried "select Id, Name from Profile" and then cast the result into Profile objects, and then scan for a Profile with Name equal to "Standard User".   However, the contents of the Profile names are unexpecting:

PT1
Custom: Marketing Profile
Custom: Sales Profile
Custom: Support Profile 
PT2
PT3
PT4
PT5
PT6

  The Profile names represented by the PT# different for different logins, and so I cannot consistently select Standard User.  Any clues, hints?

Thanks,

Tan

DevAngelDevAngel

Hi ttrieu,

Interesting behavior.  I don't like it.  I'll see if this is intended or not and if we can request a change or if we can rely on a correlation between PT# and a standard profile name.

Cheers.

DevAngelDevAngel

Hi ttrieu,

I have some more information about your post.  The profiles represent a special challenge in that the profile names are stored with a level of indirection.  The PT# represents a "label".  As you know, we support 11 languages in the product.  Standard User for instance, will be represented differently in the user's chosen language.  This means we cannot store the name directly in the object, but need to store a pointer to a label table that contains Standard User.  This makes querying on the profile name difficult.  We realize that this is making your job difficult and are working to come up with a solution so that you can query on the profile name.

In the mean time, you can use the actual id's of the profiles in your queries.  You can obtain them from the ui.  We are aiming for our next major release to have a fix for this issue.

Cheers

ttrieuttrieu

Thanks for the info, and I'll work with the id's in the query.

Tan

coinfindercoinfinder

Dave,

Is there a solution in version 5 for this problem? I could use a locale-based web service api call for my app.

Thanks,

Tim

darozdaroz
Unfortunately it doesn't appear to be corrected, either in 4.0 or 5.0.
DotNetDevilDotNetDevil

Profile names are still not available. Please respond, Shall i change it to Hardcoded in the application.

Thanks
Gagan

DevAngelDevAngel

So, the standard profile names are not available.

The mapping seems to be

PT1 = System Administrator

PT2 = Standard User

PT3 = Read Only

PT4 = Solution Manager

PT5 = Marketing User

PT6 = Contract Manager

AlanFAlanF
This sames to have changed in API 6.0 or 7.0.  And it now returns the translated name.  Is there a way to get the name in a particular language?

So, now if my user's langauge is French, I get the French translation for the profile names.

What I would like to do is always get the English version of the profiles names.

Message Edited by AlanF on 08-17-2006 09:15 AM

SuperfellSuperfell
The names of the standard profiles are returned in the current language of the user making the query.