2

I notice that the metadata of custom objects (fields, sobjects) that I retrieve from my Dev org using the Org Browser (VS Code) have a <deprecated>false</deprecated> element in them. The documentation for CustomField simply says deprecated / boolean / Reserved for future use. Same for CustomObject.

This is, now that SFDX: Diff File Against Org is broken since almost a month, one more step towards a situation where I cannot in effect compare what I have in my project with what is in the Org. Before this new development I could still do such a comparison using Beyond Compare; but now, when a file is marked different, I don't know if its just the <deprecated> element or not ...

Questions:

  • Can I just remove the <deprecated> elements?
  • Can I do something to stop the <deprecated> elements from spreading in my code base?
  • Can anybody give some useful advice on how to handle this situation?

It seems that a similar thing has happened almost eight years ago: see this post.

3

<deprecated>false</deprecated> Where is it documented, Where does it come from?

It's not really used at the moment, as far as I can tell, but the intent is, if you upgrade an Unlocked or Managed Package, this field will be set to true, meaning that the component is no longer "used." I'm not sure if it's being used for this purpose right now, but that appears to be its future use case.

Can I just remove the <deprecated> elements?

Yes, you can safely ignore those elements.

Can I do something to stop the <deprecated> elements from spreading in my code base?

Can anybody give some useful advice on how to handle this situation?

These should be version dependent. Make sure you're using the same API version for all of your source metadata (found in sfdx-project.json). If you're in the habit of bumping up your version, but not refreshing the files, this can be a cause. Setting it back down to about 50.0 or so should prevent this field from appearing.

(Note: I'll do some testing of my own, but do feel free to let me know if you find out the appropriate version cutoff for this attribute).

You can safely mass-remove those attributes (e.g. VS Code Find in Files/Replace All), or make sure you update all of your metadata with a fresh force:source:pull or force:source:retrieve to get everything in alignment.

1
  • I have been working with a project that uses version 52.0 since the beginning of this year and never saw a deprecated attribute before last week; I have recently added several record-triggered flows that show version 53.0 (I think one cannot choose the API version of flows in the flow builder tool), and because I don't know what the difference would be, I have not changed that setting in the metadata.
    – willeg
    Dec 5 '21 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.