apex-recipes icon indicating copy to clipboard operation
apex-recipes copied to clipboard

Update NamedCredentials using Connect.API

Open pavankumar9849 opened this issue 1 year ago • 2 comments

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!

pavankumar9849 avatar Apr 24 '24 07:04 pavankumar9849

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

github-actions[bot] avatar Apr 24 '24 07:04 github-actions[bot]

Nobody is there to answer my question?

pavankumar9849 avatar Apr 25 '24 09:04 pavankumar9849

@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

msrivastav13 avatar Jun 08 '24 10:06 msrivastav13