You need to sign in to do that
Don't have an account?
tyler_jennings
Accessing LicenseType attribute of Profile from Apex code doesn't work
Someone tell me why this won't compile, I can see the LicenseType column in the apex explorer. I can also run the below SOQL query fine (minus the where clause).
Code:
Code:
Profile p = [Select p.LicenseType from Profile p where id = :UserInfo.getProfileId()]; System.debug(p.LicenseType);
LicenseType was replaced by UserLicense in the 10.0 API, you could switch to using that instead.
Profile p = [select UserLicense from Profile Where id = :UserInfo.getProfileId()];
Compilation error: No such column 'UserLicense' on entity 'Profile'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. QC Sandbox/Apex Triggers ClosedCaseModificationCheck.tgr line 2 1187981866252 125
Profile p = [select UserLicenseId from Profile Where id = :UserInfo.getProfileId()];
Jason
Message Edited by TehNrd on 08-24-2007 01:31 PM
If this is in reference to your other thread
http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=912
you don't really need the name. If you don't want a portal user to be able to edit a record you could do something like:
Warning: pseudo code (not even close to syntactically correct)
if(p.UserLiscenceID == 100T409dckdkasuf93 && case.Status == Closed){
case.AddErro('You dont have permission');
}
Where that 100T49...is the portal user license type.
If this is all you are trying to do I would strongly recommend using out of the box salesforce.com functionally before turning to Apex if possible. Could you just create a separate page layout for portal users that does not give the ability to edit the case?