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.
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
-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.