I am writing a query to upload the contentversions which are not present in my Organization. For this, I am checking the presence of contentversion if it exists or not. This hit a snag where the query:
SELECT ID FROM CONTENTVERSION WHERE ID IN ('068c0000000FYd5AAL')
fails with 'Invalid parameter value' if this particular Id is not present. If it is present, the corresponding Id is returned. A strange behaviour is that if an Id is not present in the list of Ids, the error is returned.
I wouldn't want to test by running query against every id on my side as it would be a waste of API Calls. Is there a way that I can make it certain that the ContentVersion that is being uploaded doesn't exist already?
ContentDocument
has multipleContentVersions
. What is the starting condition in the database versus the input data set?