Problem while calling Outbound Rest message via business rule

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2018 09:52 PM
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);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2018 11:20 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2020 01:20 PM
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');