0

My team and I have been trying to build a SFDC integration where we simply upsert data to Salesforce, with the objects schema defined in a managed package. However, we've been running into many hurdles even following basic tutorials.

We used this link as a reference to attempt generating a package. However, when creating, I would encounter "Resource does not exist" errors. When running sf package list or any of its variants, it returned "sObject type 'Package2' is not supported". We did some digging and thought it was a permissions issue, but after setting up permissions per this doc, still the same result.

Stepping back, we could not even create scratch orgs following the scratch org trailhead - that would result in a "failed to deploy" error.

Nothing before those steps seemed to indicate any error: installation, authentication, setting default orgs, etc.

One of the hurdles right now is that the error messages are pretty generic; “No resource found”, “Failed to deploy”, “sObject not supported”, so it’s been quite difficult to narrow down searches online; and even then the solutions available are limited and all over the place. There’s been a fair bit of guessing and assuming. It also seems like the unification of SF and SFDX happened pretty recently, so much documentation/blogs refer to SFDX still (like the package generation article), and SFDX commands throw depreciation warnings which adds a bit of uncertainty.

Could these be due to local environment issues or setup? sf/sfdx has been installed and re-installed a few times on my system.

We are unfortunately pretty inexperienced working with SFDC or SFDX so any direction or insights would be appreciated.

Env:

  • OS: MacOSX 13.0
  • Node: 16.15.0
  • SFDX CLI: 7.202.7
  • SF CLI: 1.80.0
  • Org API v: 57.0 (tried 50.0 as well)

Full error messages referenced above:

  • A scratch org was created with username [email protected], but the settings failed to deploy due to: Not available for deploy for this API version
  • The requested resource does not exist
  • ConvertedFromPackageId,PackageErrorUsername from Package2 ORDER BY NamespacePrefix ^ ERROR at Row:1:Column:241 sObject type 'Package2' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Some other referenced links we tried:

1 Answer 1

0

I believe that all of these issues point to missing prerequisites or bad config. They're not surprising if you're getting started with Salesforce packaging, which is a little different than artifact creation in most stacks.

A scratch org was created with username [email protected], but the settings failed to deploy due to: Not available for deploy for this API version

You should be looking at your scratch org config (usually in config, a JSON file) under the settings key for this one. Does it match what you expect? If you're trying to use brand-new settings (introduced in the latest Salesforce release), make sure to set your project API version to the very latest - 58.0, for Summer '23.

I am surprised you would see this if you did not deliberately change the settings for your scratch orgs. You could try creating a new project to see if the issue occurs there, and compare the org config files.

The requested resource does not exist

This probably indicates that the org that is configured as your Dev Hub is not a Dev Hub or does not have second-generation packaging turned on.

Make sure to do the steps in this documentation, and validate that you are using the org you think you are by doing sfdx force:org:list. The org with (D) in its listing is your default Dev Hub org. Also make sure that the user you authorized in that org has the Permission Set you previously set up to provide packaging permissions.

ConvertedFromPackageId,PackageErrorUsername from Package2 ORDER BY NamespacePrefix ^ ERROR at Row:1:Column:241 sObject type 'Package2' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

This likely has the same cause as the one immediately above.

You must log in to answer this question.

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