This KB is for developers who have come across Exception ""Illegal access to outbound HTTP in Security Incident Response." when triggering a REST message update of the current record with a business rule.
Release or Environment
Due to the remote server, not always responding quickly enough, the script fails with the "Illegal access to outbound HTTP in Security Incident Response."
That is because the REST API call/ update is not fast enough to get processed real time and it times out
The REST call must be asyncronously porcessed with the following code using RESTmessageobj.executeAsync() instead of RESTmessageobj.execute()
var r = new sn_ws.RESTMessageV2('REST MESSAGE NAME HERE', 'post');
r.setStringParameterNoEscape('id', VARIABLE FOR ID HERE');
var response = r.executeAsync();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
this.json = new global.JSON().decode(responseBody);