function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dr. Thomas MillerDr. Thomas Miller 

Secret Secure Storage - Named Credentials

The Secret Secure Storage - Named Credentials code that you are asked to inject into APEX is incorrect. Rather than

public string getOpenPortal() { HttpRequest req = new HttpRequest(); req.setEndpoint('callout:MagicPortal'); req.setMethod('GET'); Http http = new Http(); HTTPResponse res = http.send(req); return res.getBody(); }

it should be

public void openPortal() {  HttpRequest req = new HttpRequest();  req.setEndpoint('callout:MagicPortal');  req.setMethod('GET');  Http http = new Http();  HTTPResponse res = http.send(req);  portalStatus = res.getBody() ;  }

I.e. do not return the body but put it into portalStatus.