3

I'm developing an api integration feature from Salesforce to an external web service in a managed package using External Service, Named Credential and Flow.

The feature works in a packaging org but doesn't work in a subscriber org. The error title is "Callout failed: The callout couldn't access the endpoint."

It looks like a namespace issue when a system refers to a named credential like this: named credential problem

However, I can only choose a Named Credential declaratively in the External Service setting screen, so I have no idea if it refers namespace or not.

enter image description here

Do you guys have any idea to solve this issue or to know an External Service refers a namespace?

Additional Info:

My Schema

 {
  "swagger": "2.0",
  "info": {
    "title": "Slack + Salesforce",
    "description": "Instantly Send Messages to Slack from Salesforce",
    "version": "1.0.0"
  },
  "host": "hooks.slack.com",
  "schemes": [ "https" ],
  "paths": {
    "/workflows/myworkflowid": {
      "post": {
        "consumes": [ "application/json" ],
        "parameters": [
          {
            "in": "body",
            "name": "slackMessageRequest",
            "type": "object",
            "required": true,
            "schema" : {
              "$ref" : "#/definitions/SlackMessageRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Operation"
          }
        }
      }
    }
  },
  "definitions": {
    "SlackMessageRequest": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string"
        },
        "organization":{
           "type": "string"
        },
       "error_name":{
           "type": "string"
        },
      "log_number":{
           "type": "string"
        },
      "record_url":{
           "type":"string"
        },
      "skill":{
         "type": "string"
       },
      "error_stack":{
         "type": "string"
       }
      }
    }
  }
}

My named credential

enter image description here

1
  • Have you looked at the -meta.xml files that make up your managed package metadata? You should, after all, be storing it all in version control for your package development. You can even try adding the namespace prefix to the reference to the named credential then push the metadata to a scratch org to see if the change is valid before trying to create a new package version.
    – Phil W
    Jun 13 at 6:58

1 Answer 1

2

The issue you are facing is already filed as a bug in Salesforce internally(#W-11058954). According to this, users are unable to make callout for Namespace'd managed package External Services.

When we make the External Service callout, we don't use the full NamedCredential name with the namespace. So it is unable to find the named credential causing the error.

There is no public-facing known issue for this bug at the moment. The ETA for the bug fix is Winter'23(Safe Harbour)

Hope this helps!

1
  • 1
    Thank you for your detailed comment! That helps a lot. Then I will re-develop this feature by Apex. Thanks. Jun 14 at 8:10

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.