2

This question relates very much to Unable to Set Created date even after enabling Set Audit Fields

However, my problem is specifically related to the Knowledge__kav SObject.

I'm trying to import existing knowledge articles into salesforce from a legacy system and for compliance reasons, I need to keep the same CreatedDate.

I've given the running user a permission set, which has the permission "Set Audit Fields upon Record Creation" enabled. When trying to set CreatedDate on Account and ContentVersion sobjects, it works fine, but not for Knowledge__kav.

I tried importing the data both via the API and via APEX. Via the API, the insert is successful, but the CreatedDate is overwritten with the current DateTime. A before insert trigger revealed that CreatedDate was null before insert. Via Apex, I get the error "FATAL_ERROR System.SObjectException: Field is not writeable: Knowledge__kav.CreatedDate"

I can't find any documentation stating that the behaviour of "Set Audit Fields upon Record Creation" is different for Knowledge__kav. Does anyone know?

1 Answer 1

3

The knowledge article Considerations and activation of 'Create Audit Fields' has a list of objects that are available for these kinds of updates, and unfortunately Knowledge Article isn't one of them.

Perhaps you could make use of a custom field somehow so that the data is still there?

3
  • Ahhh! Thank you. At least its now clear that this is not supported, even though it's a pitty.
    – Andreas86
    Commented May 6, 2021 at 11:36
  • 1
    I talked to salesforce, and they confirmed that it is not possible to allow this for knowledge__kav, and there is already an Idea for this: trailblazer.salesforce.com/ideaView?id=08730000000E2SfAAK
    – Andreas86
    Commented May 6, 2021 at 14:05
  • @Andreas86 Voted for the idea! Commented May 6, 2021 at 14:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .