apex-recipes
apex-recipes copied to clipboard
Update NamedCredentials using Connect.API
Hi , I am a new Bee to salesforce , I am not able to get an idea on how to implement a code to update my calloutURL of NamedCredential for my salesforce org using the connect API. I heard that this is a new extensible from 23 onwards , Please share any code samples or any tutorials how can I update .
Thanks in Advance!
Thank you for posting this issue. 🙇🏼♂️
We will come back to you shortly.
Nobody is there to answer my question?
@pavankumar9849 Sorry for delayed response. You can use the below to update an endpoint
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_NamedCredentials_static_methods.htm#apex_ConnectAPI_NamedCredentials_patchCredential_4
We will have recipes for it soon. For now you can also get the NamedCredentialRecipes here
https://github.com/trailheadapps/apex-recipes/blob/main/force-app/main/default/classes/Integration%20Recipes/NamedCredentialRecipes.cls