Problem while calling Outbound Rest message via business rule

Community Alums
Not applicable

Hi Friends,

While calling outbound rest message from Async business rule i am getting the below error 

REST Msg Outbound - RESTMessageClient : Error constructing REST Message/Method: IPinfo/GetIPInfo: com.glide.generators.InvalidGlideRecordException: Unable to find REST Message Record with Name

 

I have crosschecked manytimes the correct name of rest message and method , I have gone through lot of articles

related to this error but still couldnt find the exact solution. Can anyone please help me in this ASAP

 

Note: I am working in scoped application 

PFB code if needed

 

(function executeRule(current, previous /*null when async*/) {

// Add your code here
gs.addErrorMessage('Inside Business rule ASYNC');

try {
var r = new sn_ws.RESTMessageV2('IPinfo', 'GetIPInfo');
gs.addErrorMessage('Testing test message ....'+r);
r.setStringParameterNoEscape('spec', 'geo');
r.setStringParameterNoEscape('ip_add', current.ip_address);

var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}
catch(ex) {
var message = ex.message;
}
})(current, previous);

 

 

6 REPLIES 6

I would suggest adding gs.info() to debug you code in each step to find out where exactly you code is failing.


Please mark this response as correct or helpful if it assisted you with your question.

I ran into the same issue.  It may have to do with the Scope of the REST Method/Message.  If the REST portion is in global scope, you will need to use the global.<REST Message>

E.g.

var r = new sn_ws.RESTMessageV2('global.myRestMessage', 'DEFAULT GET');