You need to sign in to do that
Don't have an account?
Ameer Basha 34
How to Get Multiple Record ID's from GetRequest.requestURI from HTTPGET
Hi everyone,
I got struct from hours I am unable to find how to get multiple record id's from HTTP Get request i.e;
RestRequest GetRequest = RestContext.request;
RestResponse GetResponse = RestContext.response;
String AccountId = GetRequest.requestURI.substring(GetRequest.requestURI.lastIndexOf('/')+1);
the above is getting single record id. I want to get Multiple Record id's means of list of id's...Please help me on this..Thanks in Advance...
I got struct from hours I am unable to find how to get multiple record id's from HTTP Get request i.e;
RestRequest GetRequest = RestContext.request;
RestResponse GetResponse = RestContext.response;
String AccountId = GetRequest.requestURI.substring(GetRequest.requestURI.lastIndexOf('/')+1);
the above is getting single record id. I want to get Multiple Record id's means of list of id's...Please help me on this..Thanks in Advance...
Does https://salesforce.stackexchange.com/questions/239876/how-to-use-httpget-service-to-get-a-list-of-objects-and-create-them help?
The approach is to try something like
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Thank You for your response,
RestRequest GetRequest = RestContext.request;
RestResponse GetResponse = RestContext.response;
String AccountId = GetRequest.requestURI.substring(GetRequest.requestURI.lastIndexOf('/')+1);
List<String> ids = AccountId.split(',');
set<Id> SetOfLeadIds= new set<Id>();
for(Id idOf : ids){
SetOfLeadIds.add(idOf);
system.debug(idOf);
}
List<Account> AccountsAndChildRecords = [select id,Name From Account WHERE Id IN :SetOfLeadIds];
I have written like this and I got the output..
Thank You,
Ameer