You need to sign in to do that
Don't have an account?

SOQL data type issue
Have a custom field Weight on Contact object. There is a validation rule which prevents this field from editing after Pet-ID (custom field) is saved. We have an apex controller which lets only Profile1 Team to edit it. However now, we want System Administrators to edit this field as well. If i changes SOQL to SELECT Id from Profile where Name = 'Profile1' or 'System Administrator', end up getting two results. Have to change data type which i do not want. Is there an easier way to do this?
Initial logic was,
Id setProfileId = [SELECT Id FROM Profile WHERE Name = 'Profile1 Team' LIMIT 1].Id;
this.isSetUser = UserInfo.getProfileId() == setProfileId;
Initial logic was,
Id setProfileId = [SELECT Id FROM Profile WHERE Name = 'Profile1 Team' LIMIT 1].Id;
this.isSetUser = UserInfo.getProfileId() == setProfileId;
Hi Scotty,
Could you please elaborate how using
SELECT Id from Profile where Name = 'Profile1' or 'System Administrator', end up getting two results and then why it caused to change data type ?
I guess once possible solution could be like below:
Please let me know if it helps.
Regards,
Ashish Kr.
All Answers
Hi Scotty,
Could you please elaborate how using
SELECT Id from Profile where Name = 'Profile1' or 'System Administrator', end up getting two results and then why it caused to change data type ?
I guess once possible solution could be like below:
Please let me know if it helps.
Regards,
Ashish Kr.