I'm new to this so please forgive my ignorance.
I'm getting the exception when:
- insert an Opportunity
- insert a ContentVersion
- post the new ContentVersion to the Opportunity's chatter feed
- delete the Opportunity
Does anybody know why, and if so, how to overcome the exception?
I am using API version 26.0
Thanking you in advance
private static void TestOpportunityDeletion()
// create an opportunity
Opportunity opp = new Opportunity() ;
opp.Name = 'Test Name' ;
opp.StageName = 'Test Stage Name' ;
opp.CloseDate = Date.Today() ;
insert opp ;
// attach a document to its chatter feed
ContentVersion doc = new ContentVersion() ;
doc.Title = 'Test Version' ;
doc.PathOnClient = 'test version.docx' ;
doc.VersionData = Blob.ValueOf( 'test content' ) ;
doc.Origin = 'H' ;
insert doc ;
FeedItem post = new FeedItem() ;
post.Type = 'ContentPost' ;
post.ParentID = opp.Id ;
post.RelatedRecordID = doc.id ;
insert post ;
// delete the opportunity
delete opp ;
I am following the book "Developement with the Force.com platform" by JasonOuelette.
When creating the Custom Objects, I did not check the box to be visible in a tab, and so I could not add this object to the Custom App I was creating. Now I have a created fields and relationships in the custom object. How do I add this Object to the Custom App?