4

I am trying to see whether user has the create permission for a particular object.

I managed to get till here:

Schema.DescribeSObjectResult s = test__C.sObjectType.getDescribe();

And on debug i can see below as well:

Schema.DescribeSObjectResult[getKeyPrefix=a0C;
getLabel=test;
getLabelPlural=tests;
getName=test__c;
isAccessible=true;
isCreateable=true;
isCustom=true;
isCustomSetting=false;
isDeletable=true;
isDeprecatedAndHidden=false;
isFeedEnabled=true;
isMergeable=false;
isQueryable=true;
isSearchable=true;
isUndeletable=true;
isUpdateable=true;]

How do i now check against isCreateable() here?

4

As far as I know, you can use:

Schema.DescribeSObjectResult s = test__C.sObjectType.getDescribe();
Boolean isCreateable = s.isCreateable();
|improve this answer|||||
  • I have been trying to do the same,but will give me a compile error. Method does not exist or incorrect signature: [Schema.DescribeSObjectResult].isCreatable() – sfdc99999 Dec 12 '13 at 8:10
  • 3
    d'oh! I had a typo, it's s.isCreateable(), with an e. – rael_kid Dec 12 '13 at 8:12
  • 3
    oh!!! i just realised i have been doing the same typo all this time :D – sfdc99999 Dec 12 '13 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.