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

Covering FLS is createable and isUpdateable conditions in test class
Hi All,
I am checking in my class whether the fields of object are createable. I am using this condition in the objects. I am using Schema.sObjectType.Case.fields.fieldname.isCreateable in the if loop. I have 10 fields like this for which I am checking. For this if loop the code is not getting covered in the test class.
I have tried to run as system admin using system.runAs() but that ios also not covering the test class.
Thanks,
Anuj
I am checking in my class whether the fields of object are createable. I am using this condition in the objects. I am using Schema.sObjectType.Case.fields.fieldname.isCreateable in the if loop. I have 10 fields like this for which I am checking. For this if loop the code is not getting covered in the test class.
I have tried to run as system admin using system.runAs() but that ios also not covering the test class.
Thanks,
Anuj
I am not sure if i got your requiremnt correct but i tried below code and its working fine for me and returning 100% test coverage.
Test Class-