DML check in Salesforce Apex
48K views
Apr 16, 2025
Show More Show Less
View Video Transcript
0:06
hello everyone in this video we are
0:08
going to see how to do DML check in
0:13
Salesforce using
0:15
Apex let's say we
0:17
have uh insert update or delete
0:21
statement before that if you wanted to
0:23
check whether this particular running
0:26
user have uh create or update or delete
0:30
access then we have two
0:33
options the first option is we can use
0:36
schema. S object type dot the API name
0:40
of the object so here I'm using account
0:42
object if you are using custom object uh
0:45
use the custom object API name dot is
0:48
creatable if it is true then they will
0:51
be able to insert the records if is
0:54
updatable Method returns true then they
0:57
have edit access if is deletable method
1:01
uh returns true then they will be able
1:04
to delete the records another option is
1:06
we can make use of describe s object
1:09
result so here I'm using account. S
1:13
object type. get
1:14
describe uh and then I'm getting the
1:17
describe as object result from there we
1:20
can make use of three methods uh are
1:24
four methods here one is queriable
1:26
whether they can query those records
1:28
whether they have at least read access
1:30
to it next is whether they can create
1:32
using the same is creatable is updatable
1:35
for update and is deletable for um
1:38
deleting the records let me remove this
1:42
one so that we can execute and check
1:50
it I'm going to execute it and check it
1:54
I am a system admin so everything should
1:56
be true for account
1:58
object
2:06
so everything is
2:11
true please check the video description
2:14
in the video description I have shared
2:16
my blog post from the blog post you
2:18
should be able to get the sample Apex
2:20
code which was referenced in this
2:28
video
2:32
I hope it was
2:41
helpful thank you for
2:56
watching
#Internet Software