• phil.vasey
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies

Setup > Create > Packages > [MyManagedPackage] > Components > View Dependencies

 

I get the following exception:

 

Cannot Modify Managed Component

The component you are attempting to modify is part of a managed package, and cannot be modified.

 

 

Does anybody know why this might happen, and how I might find out which component?

 

Thanks

Setup > Create > Packages > [MyManagedPackage] > Components > View Dependencies

 

I get the following exception:

 

Cannot Modify Managed Component

The component you are attempting to modify is part of a managed package, and cannot be modified.

 

 

Does anybody know why this might happen, and how I might find out which component?

 

Thanks

private static testmethod void UnitTest_DeleteOpportunity()
{
// create an Account

Account testAccount = new Account() ;
testAccount.Name = 'Alpha Corporation' ;
insert testAccount ;

// create an Opportunity on that Account

Opportunity testOpportunity = new Opportunity() ;
testOpportunity.AccountId = testAccount.Id ;
testOpportunity.Name = 'Alpha Holdings PLC' ;
testOpportunity.StageName = 'Negotiation/Review' ;
testOpportunity.CloseDate = Date.Today() ;
insert testOpportunity ;

// create a ContentVersion

ContentVersion testContentVersion = new ContentVersion() ;
testContentVersion.Title = 'Test Document' ;
testContentVersion.PathOnClient = 'Test Document.docx' ;
testContentVersion.VersionData = Blob.ValueOf( 'Test Document Version' ) ;
testContentVersion.Origin = 'H' ;
insert testContentVersion ;

// add that ContentVersion as a FeedItem to the Opportunity

FeedItem testFeedItem = new FeedItem() ;
testFeedItem.ParentID = testOpportunity.Id ;
testFeedItem.RelatedRecordID = testContentVersion.Id ;
testFeedItem.Type = 'ContentPost' ;
insert testFeedItem ;

// test: delete the Opportunity raises an exception

String expectedStart = 'Delete failed. First exception on row 0 with id ' ;
String expectedEnd = '; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []' ;
String actual = '' ;
try
{
delete testOpportunity ;
}
catch ( Exception e )
{
actual = e.GetMessage() ;
}
System.AssertEquals( true, actual.StartsWith( expectedStart ) ) ;
System.AssertEquals( true, actual.EndsWith( expectedEnd ) ) ;
}

 

 

Can anybody explain why this exception is being raised?

Hi All

 

My storage usage reports:

 

Current File Storage Usage    

Record Type   Record Count   Storage   Percent
Attachments   0              0 B       0%
Documents     2              5 KB      0%
Content       363            22.1 MB   100%
Photos        4              19        KB 0%

 

However, the following SOQL statement returns no records:

 

     [ SELECT Id FROM ContentDocument ]

 

I am the administrator with "View All" permission.

 

Can anybody explain this please?

 

Hi All

 

My storage usage reports:

 

Current File Storage Usage    

Record Type Record Count Storage Percent
Attachments 0 0 B 0%
Documents 2 5 KB 0%
Content 363 22.1 MB 100%
Photos 4 19 KB 0%

 

However, the following SOQL statement returns no records:

 

     [ SELECT Id FROM ContentDocument ]

 

I am the administrator with "View All" permission.

 

Can anybody explain this please?

 

 

I can supply code if you wish, but here is my problem:

 

  1. Create some host record
  2. Create a FeedItem on that host record with a DOCX content
  3. This creates TWO ContentDocumentLink records; one linked to the host record and one linked to the User
  4. Create another FeedItem on that host record with a PDF content
  5. This creates another TWO ContentDocumentLink records
  6. Delete the host record with a trigger that deletes its FeedItems and also deletes their ContentDocuments

The DOCX ContentDocument has gone, but the PDF ContentDocument is still there.

 

The original ContentDocumentLinks for the PDF have gone, but a new ContentDocumentLink record linked to the User has been inserted (different Id).

 

Can anybody explain why this new link is inserted?

 

Furthermore, even with admin permissions, this new link cannot be APEX deleted (FIELD_INTEGRITY_EXCEPTION).

Hi

 

I'm new to this so please forgive my ignorance.

 

I'm getting the exception when:

 

  1. insert an Opportunity
  2. insert a ContentVersion
  3. post the new ContentVersion to the Opportunity's chatter feed
  4. 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 ;
}

Setup > Create > Packages > [MyManagedPackage] > Components > View Dependencies

 

I get the following exception:

 

Cannot Modify Managed Component

The component you are attempting to modify is part of a managed package, and cannot be modified.

 

 

Does anybody know why this might happen, and how I might find out which component?

 

Thanks

Hi All

 

My storage usage reports:

 

Current File Storage Usage    

Record Type   Record Count   Storage   Percent
Attachments   0              0 B       0%
Documents     2              5 KB      0%
Content       363            22.1 MB   100%
Photos        4              19        KB 0%

 

However, the following SOQL statement returns no records:

 

     [ SELECT Id FROM ContentDocument ]

 

I am the administrator with "View All" permission.

 

Can anybody explain this please?

 

Hi

 

I'm new to this so please forgive my ignorance.

 

I'm getting the exception when:

 

  1. insert an Opportunity
  2. insert a ContentVersion
  3. post the new ContentVersion to the Opportunity's chatter feed
  4. 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 ;
}

Hi,

when attempting to delete a list of FeedItems I'm getting the following error:

 

EXCEPTION: System.DmlException: Delete failed.

First exception on row 1 with id 0D5G000000h9c6ZKAQ; first error:

DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []

 

As I understand it the DUPLICATE_VALUE error is for then you try an insert/update/upsert and you have a duplicated value in a unique field, I don't understand why is this firing on a DELETE operation.

 

I checked and don't have duplicate FeedItems in the list, I even tried doing:

 

List<FeedItem> fiList = [SELECT Id FROM FeedItem WHERE Id in ('id1', 'id2')];
delete fiList;

 and I'm still getting the same error.

 

I have just one trigger and I alredy tried disabling it and the error still happens.

 

The error doesn't happen always, but I can't find any logic to why is happenning.

 

Any ideas of why this may be happening or how to fix it will be greatly appreciated.

 

Thank you