function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VIKASH CHAND KUMARVIKASH CHAND KUMAR 

ContentVersion object not available in Profile

I am getting error "Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.: [NetworkId]"  while creating ContentVersion. when i am trying to find "ContentVersion" object in Profile, its not there. 
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Access  to content vesrion is controlled by parent.Lets Suppose If you are trying to insert contentversion of an account then the user should have access to account.This error might be because the user doesnt have access to the parent object.
Please refer below link which might help you in this
https://salesforce.stackexchange.com/questions/285396/unable-to-insert-contentversion-record-as-a-community-user-in-test-class
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/api/sforce_api_objects_contentversion.htm

Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.

Thanks and Regards
Mahesh PetheMahesh Pethe
You cannot find Content Version in any profile for giving access, its parent object needs all access. Morover 'ContentDocumentId' is stored in 'ContentDocumentLink' table in Salesforce which has 'ShareType' column , check the value of it, the value needs to be 'I' then only you can insert the attachment in ContentVersion. Also check the 'visibility' column for further help. Hope this helps. Kindly mark it as solved so that it may help others in future.