How do I check the access of current user on particular object dynamically. I have a custom mapping object in that I am storing object name in the string. I want to check Whether the current user has access to that object or not. Like this
Schema.sObjectType.Account.isCreateable()
instead of account there can be any name. like
Schema.sObjectType.customobject1.isCreateable();
Schema.sObjectType.customobject2.isCreateable();
& to convert I used this code
// I have Account name in String
String objectStr = 'Account';
// Convert to schema.sObjectType
Schema.SObjectType convertType = Schema.getGlobalDescribe().get(objectStr);
Still It is giving error like
Method does not exist or incorrect signature: Schema.sObjectType.convertType.isCreateable()
Please Guide me!
Thanks in advance!
objectStr
value i.eAccount
, not the type ofObject
. Try with type of object.