function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anderson CardosoAnderson Cardoso 

HTTP Status=Service Unavailable, StatusCode=503 only in the Partner Community

private static String buscaFiltroListView(String sIdListView)
{
	Http http = new Http();
	HttpRequest request = new HttpRequest();
	request.setEndpoint
	(
		URL.getSalesforceBaseUrl().toExternalForm()+
		'/services/data/v32.0/sobjects/Cliente_conceito__c/listviews/'+sIdListView+'/describe'
	);
	request.setHeader('Authorization','Bearer '+UserInfo.getSessionId());
	request.setMethod('GET');
	HttpResponse response = http.send(request);
		
	map<String, Object> mapCC = (map<String, Object>) JSON.deserializeUntyped(response.getBody());
		
	String sQuery = (String)mapCC.get('query');
		
	return sQuery.substringAfter('WHERE').substringBefore('ORDER');
}
Hi everyone!

This code works very well when a internal user trigger it, but when is a partner user, it shows me the follow error:
"System.HttpResponse[Status=Service Unavailable, StatusCode=503]"

And this is my request:
"System.HttpRequest[Endpoint=https://polimold.force.com/services/data/v32.0/sobjects/Cliente_conceito__c/listviews/00B50000007Z27KEAS/describe, Method=GET]"

All start by a list button.

Could you help me?
Anderson CardosoAnderson Cardoso
If someone knows another way to retrieve the filter from a list view... because I need more than 200 records and... I would like to avoid a visualforce.
ArreyYaarArreyYaar
Hi Anderson,

I may be wrong but just try it once if it works...

Whenever you access a list view the URL has a special prefix of 'fcf=listviewid', please refer a few below in my org -
Account  = https://lightningpoc-dev-ed.my.salesforce.com/001?fcf=00B36000002P7Zx
Contact = https://lightningpoc-dev-ed.my.salesforce.com/003?fcf=00B36000002P7Zq
Custom Object = https://lightningpoc-dev-ed.my.salesforce.com/a07?fcf=00B36000005zNnl

on the same lines, try updating your request URL to have this special character

Regards,
M
Anderson CardosoAnderson Cardoso
Hi ArreyYaar, to a http request my endpoint need to be some like this: base + '/services/data/v32.0/sobjects/Cliente_conceito__c/listviews/00B50000007Z27K/describe

If you looking for the same thing in a internal org you would see the same url, equals in your example, changes only the base.
sony sonusony sonu

hi Anderson Cardoso, is your problem got solved<<<<
hi !!!!!! nice to meet you ....i need a help , that 
is it possible to make rest callouts from salesforce to the external application , which is hosted locally i.e local server (private) not published yet ...actually i had used rest callout and given the endpoint url of external application and passed keyvalue in headers ,which is hosted in privately, iam getting an error 503 unavailable, 
one of our network team member is asking to provide the unique portnumber, we have sugested and they had enabled 80,443 as default, bt iam gettting the same errror ..do you have any solution, it will be appreciated

the end point url is correct ...bt if accessing from salesfroce it is showing an error 503 service un available... may i know y?? if url is in private mode is it is not used for callouts??
i had posted in developer community.. i had not got the solution still...thanks in advance....

the external application url is not hosted publicly , ,,it is in local server...we need to connect to it and make a callout and get the response