[SalesForce] FirstPublishLocationId empty after new File version

When uploading a file to a record, the FirstPublishLocationId of the file is set to the id of the record.

When uploading a new version of that file, and running a query on the file in dev console, the FirstPublishLocationId column is now blank.

Any ideas why this is happening?

Best Answer

As per the definition of the field :-

This field is only set the first time a version is published via the API. FirstPublishLocationId can’t be set to another ID when a new content version is inserted.

This field contains the ID of the location where the version was first published. If the version is first published into a user's personal library or My Files, the field will contain the ID of the user who owns the personal library or My Files. If the first version is published into a public library, the field will contain the ID of that library.

If see the property:-

It can be Create, Filter, Group, Nillable, Sort only. Not update.

Read more here:- ContentVersion

Related Topic