You need to sign in to do that
Don't have an account?
ForceLover
How to know whether current login user has edit permission to lead object or not in Apex
Hi Everyone.
I want to know current login user has edit permission to lead object or not ...
Thanks in Advance
Sorry I forgot about brackets....
Schema.DescribeSObjectResult R = Lead.SObjectType.getDescribe();
boolean canAcess=R.isAccessible();
boolean canCreate=R.isCreateable();
boolean canUpdate=R.isUpdateable();
boolean candelete=R.isDeletable();
All Answers
To check any type of Lead access, You can try following statements:
Schema.DescribeSObjectResult R = Lead.SObjectType.getDescribe();
boolean canAcess=R.isAccessible;
boolean canCreate=R.isCreateable;
boolean canUpdate=R.isUpdateable;
boolean candelete=R.isDeletable;
It returns information based on currently logged user in context of which operation is performed.
Happy easter! :)
Thanks for replying it is giving me an error
ConvertLeadsController Compile Error: Expression of type Schema.DescribeSObjectResult has no member named isCreateable
Sorry I forgot about brackets....
Schema.DescribeSObjectResult R = Lead.SObjectType.getDescribe();
boolean canAcess=R.isAccessible();
boolean canCreate=R.isCreateable();
boolean canUpdate=R.isUpdateable();
boolean candelete=R.isDeletable();
anyway it is saved..