0

I'm trying to update SearchLayouts using the metadata API via jsforce. I am basically Retrieving the CustomObject (it's for Account but I think I need to do this to change the SearchLayout), removing a field from "searchResultsAdditionalFields" and from "lookupDialogsAdditionalFields", then using the metadata Update to set it. While I get no errors, the SearchLayout just doesn't change.

Any ideas why it's not updating with update or any other approaches I can take to update SearchLayouts with the API?

8
  • You're retrieving and deploying the CustomObject in the manifest and it's a recent API version? Also are <profileSearchLayouts> in the custom object? This will override the default <searchLayouts> section. Mar 15, 2021 at 21:21
  • I'm using JSForce, so I'm using the read and update calls in JSForce. I'm not using profileSearchLayouts
    – Kat
    Mar 15, 2021 at 21:39
  • What version number is in the JSForce method call? Where are you verifying the deployment? Through setup or by doing a global search? Mar 15, 2021 at 21:43
  • Looks like I'm using 42.0, and I've been verifying by calling read again if that's what you mean?
    – Kat
    Mar 15, 2021 at 21:59
  • Give 51.0 a shot. By verifying I mean looking under the object manager in Salesforce at the search layout and seeing if it's taking. Mar 15, 2021 at 22:01

1 Answer 1

1

The takeaway here is to verify Metadata API operations in the target org if things look like they're not deploying correctly and always use the most recent API version in the operations.

There is an issue in the metadata API where the SearchLayouts need to be "jiggled" before the update in the UI due to caching. You can do this with the API as described in this response Metadata API SearchLayouts not showing updates or by going to the UI and searching for the relevant object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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