jetstreamapp / jetstream

A better way to work on Salesforce
https://getjetstream.app/
Other
79 stars 18 forks source link

Use metadata API for deploying page layouts #919

Open paustint opened 3 months ago

paustint commented 3 months ago

Describe the bug and steps to reproduce The Tooling API has some known bugs and we were able to work around a few of them, but for feed-based layouts it looks like there are a number of Salesforce bugs that appear to be unresolvable.

Solution Move to the metadata api for page layouts - this adds a lot of complexity since we have to deal with zip files and XML instead of simple JSON API requests, but it has proper support for all page layouts. This also makes handling failures more complicated because of the Salesforce response. Automation control for duplicate rules is probably the best similar example for this type of usage. The deployment will potentially be much slower in many cases using the metadata API as well.

Steps to reproduce:

  1. Enable feed tracking for an object
  2. Create a new page layout and choose the feed-based layout checkbox
  3. Fetch the page layout using tooling api (e.x. GET /services/data/v60.0/tooling/sobjects/Layout/00hHt00000W6yvM)
  4. Attempt to re-save the layout 0 there are a number of Salesforce errors on their payload parsing (PATCH /services/data/v60.0/tooling/sobjects/Layout/00hHt00000W6yvM sending only FullName and Metadata properties with the request)

rightComponents causes the first issue Cannot deserialize instance of complexvalue from VALUE_STRING value Following or request may be missing a required field at [line:1, column:698]

Setting that to null (which I am unsure of the consequence of doing so) then the following error is produced Mass quick actions don’t support ProcessInstanceStep. Use a valid entity.