Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect rest api in Apex does not automatically enabled named credentials when created #568

Open
1 task done
dewuyi opened this issue Aug 19, 2024 · 2 comments
Open
1 task done
Assignees
Labels
bug Something isn't working

Comments

@dewuyi
Copy link

dewuyi commented Aug 19, 2024

Summary

When creating a Named Credential using the Salesforce Connect API via Apex, the "Enabled for Callouts" setting is not automatically toggled on. However, when the same Named Credential is created via Postman using the same Connect API, the "Enabled for Callouts" setting is automatically toggled on.

Salesforce Org Type

Sandbox

Steps To Reproduce

Configuration:
Write an Apex class to create a Named Credential using the Connect API.
Set up the Named Credential with the required details, including URL, External Credentials, and Callout Options.
Deploy the Apex code to the Scratch Org.
Run: Execute the Apex code to create the Named Credential.

Current Behavior

The Named Credential is created successfully, but the "Enabled for Callouts" toggle is not automatically enabled, requiring manual intervention to enable it. This behavior is inconsistent with creating Named Credentials via Postman using the same Connect API, where the toggle is automatically enabled.

Expected Behavior

The "Enabled for Callouts" setting should be automatically toggled on when the Named Credential is created using the Connect API via Apex, just as it is when created via Postman.

Relevant Log Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dewuyi dewuyi added the bug Something isn't working label Aug 19, 2024
Copy link
Contributor

Thank you for posting this issue. 🙇🏼‍♂️
We will come back to you shortly.

@ChiefMahedi
Copy link

I followed the steps you provided, and the Named Credential was created successfully. The 'Enabled for Callouts' option was automatically enabled, and I encountered no issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants