forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
954 stars 406 forks source link

Missing metadata type definition in registry for id 'searchcustomization' when attempting to retrieve Search Customizations #5010

Closed FedeAbella closed 1 year ago

FedeAbella commented 1 year ago

Summary

User is attempting to retrieve Search Customization metadata via VSCode Org Browser

Steps To Reproduce:

In VSCode:

  1. Go to Org Browser
  2. Open Search Customizations
  3. Retrieve a Search Customization

Expected result

Should be able to retrieve Search Customization metadata.

Actual result

sfdx throws error Missing metadata type definition in registry for id 'searchcustomization'

Additional information

Salesforce Extension Version in VS Code: v58.7.1

SFDX CLI Version: sfdx-cli/7.209.6 win32-x64 node-v18.15.0

OS and version: Windows 11, Version 10.0.22621 Build 22621

peternhale commented 1 year ago

@FedeAbella I could not find a metadata type named SearchCustomization, however there is a type named SearchSettings. Is this the type you are looking for?

Docs for SearchSettings.

FedeAbella commented 1 year ago

That's not the one. Not sure why it's not in the docs. This is what I mean: In Setup -> Einstein -> Einstein Search -> Search Manager you can configure which objects are searchable using the global search for each profile image

And this shows up in the Org Browser in VScode as Search Customizations: image

But it fails to be retrieved: image

peternhale commented 1 year ago

@FedeAbella thanks for the detailed explanation, I learned something. The error you see is due to the underlying type for the search customization is not available for download, even though it is visible via the org browser. The team that owns that type must enable it for use in a dx project. I also see that the search customization is in beta. It is possible that the team that owns this feature will expose the new type in the future.

I was able to arrive at the same result as you are seeing with your repro steps.

You can visit the Metadata Coverage Report periodically to check on the new type. This is updated once per Salesforce release.

FedeAbella commented 1 year ago

Ah, I see. Well, I learned something too. Weird that the type is not in the coverage report, nor in the unsupported types. Maybe it's just too new? To be fair, we only bumped into it ourselves due to a weird ask in one of my projects.

Thanks for checking!