How to get application Id in server side?
(e.g. in trigger or formula field)
Thanks,
Kasipat
Hi Kasipat,
There is no direct API which list application id from server side. But still you can make REST calls in the trigger.
The following code uses two rest calls, first one will get sessionId and second will be passed to another rest call.
var url = "localhost:8080/.../login";
var params = {"loginName":"shiva.durshetti@gmail.com","password":"iworkinprogress"};
var resp = rbv_api.sendHttpPost(url, null,params, null);
var sessionId=String(resp.match(/<sessionId>(.*)<\/sessionId>/g)).replace(/<\/?[^>]+(>|$)/g, "");//This will retrieve the session id from the response
var appId="localhost:8080/.../getApplicationIds
var appParams={"sessionId":sessionId};
var appIds = rbv_api.sendHttpGet(appId);
rbv_api.print(appIds);
Regards,
Shiva
Hi Kasipat,
There is no direct API which list application id from server side. But still you can make REST calls in the trigger.
The following code uses two rest calls, first one will get sessionId and second will be passed to another rest call.
var url = "localhost:8080/.../login";
var params = {"loginName":"shiva.durshetti@gmail.com","password":"iworkinprogress"};
var resp = rbv_api.sendHttpPost(url, null,params, null);
var sessionId=String(resp.match(/<sessionId>(.*)<\/sessionId>/g)).replace(/<\/?[^>]+(>|$)/g, "");//This will retrieve the session id from the response
var appId="localhost:8080/.../getApplicationIds
var appParams={"sessionId":sessionId};
var appIds = rbv_api.sendHttpGet(appId);
rbv_api.print(appIds);
Regards,
Shiva