douglascayers / sfdc-convert-attachments-to-chatter-files

📎 Easily migrate your Attachments to Salesforce Files.
https://douglascayers.com/2015/10/10/salesforce-convert-attachments-to-chatter-files/
BSD 3-Clause "New" or "Revised" License
73 stars 29 forks source link

Error while deploying #46

Closed poojapriyanka1507 closed 6 years ago

poojapriyanka1507 commented 6 years ago

How to resolve this Test failure, method: ConvertAttachmentsToFilesBatchableTest.test_conversion_error -- System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ParentId]: [ParentId] stack Class.ConvertAttachmentsToFilesBatchableTest.test_conversion_error: line 379, column 1

Test failure, method: ConvertAttachmentsToFilesBatchableTest.test_preserve_original_inactive_owner -- System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: [] stack Class.ConvertAttachmentsToFilesBatchableTest.test_preserve_original_inactive_owner: line 335, column 1

douglascayers commented 6 years ago

Hi @poojapriyanka1507,

Looks like you're trying to install the unmanaged source code. That test has user2 try to insert an attachment related to an account owned by user1. My guess is that your org has OWD for Accounts set to Private.

You can either open OWD access up (not recommended), or create a Permission Set that grants a user View All access to Accounts then modify the test code so that user2 is granted this permission set, or modify the test code as you see fit to meet your org's requirements.

Unless you've changed the code, I recommend installing the managed package options to simplify installation into production orgs.