You need to sign in to do that
Don't have an account?
adreamer
DML not allowed on Folder
Hi All,
I am trying to insert folders as part of testing methods and I I get the following compile error: "DML not allowed on Folder" at the insert point.
I see the Folder object access includes "creatable".
Any ideas would be much appreciated.
Thanks,
Fernando
You can not create folder in Apex Class, so you will not be able to create forlder in test class. You should do a SOQL and you can use it. Please check size of folder before youtest further so that your test do no fail on the orgs where folder does not exists. Your test should be like, use this sort of condition in your test.
All Answers
You can not create folder in Apex Class, so you will not be able to create forlder in test class. You should do a SOQL and you can use it. Please check size of folder before youtest further so that your test do no fail on the orgs where folder does not exists. Your test should be like, use this sort of condition in your test.
Thanks Shashikant !
Doesn't seem to be a very good rule. Especially since they want you to create all the objects for unit tests.
http://success.salesforce.com/ideaView?id=08730000000IqJuAAK
Agreed. Why do we have to query for it? it goes against the best practices.