Howeever I never used this approach but you may modify the static resource by using the apex controller becaus the web services documentation states that StaticResource can have DML operations (and indeed, it can) and if they then you can perform the dml opration on static resource.Here is a small snippet that will help you.
StaticResource sr = new StaticResource();
sr.name = 'MyStaticName';
sr.body = Blob.valueOf(myTextContent);
sr.contenttype = 'text/plain';
insert sr;
Don't forget to give Kudos if this post helped you.
Mark my answer as a solution to your question if it solve your problem.
Hi, You can't do DML operations on StaticResource object from Apex please followthe link: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm
Hi ManjuNath,
Howeever I never used this approach but you may modify the static resource by using the apex controller becaus the web services documentation states that StaticResource can have DML operations (and indeed, it can) and if they then you can perform the dml opration on static resource.Here is a small snippet that will help you.
Don't forget to give Kudos if this post helped you.
Mark my answer as a solution to your question if it solve your problem.
Best Regards,
Choudhary Deepak Shyoran
Salesforce Developer
Hi,
I want to update not to insert.
Thanks for the reply.
Regards,
Hi,
You can't do DML operations on StaticResource object from Apex.
Please see below link:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_non_dml_objects.htm
Thanks.
Thanks for sharing this informative and amazing post here. I found it very interesting and enjoy reading this blog. Will wait for more posts.
necklace box packaging (https://huijupackaging.com/product/earring-box-jewelry-box/)
You can't do DML operations on StaticResource object from Apex
please followthe link:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm
https://trailhead.salesforce.com/content/learn/modules/visualforce_fundamentals/visualforce_static_resources
Thanks!!