• Anderson Cardoso
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 1
    Questions
  • 2
    Replies
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?
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?
I'm looking for a way to set a flow's finishlocation to render in both Salesforce1 and web. Specifically, I want the flow to finish back at the record from which it started. The flow is initiated via a hyperlink on Opportunity. After it processes, I want the user to be returned to the refreshed Opportunity record without any additional clicks.

If you can't tell from my post, I'm new to all of this. A detailed response would be much appreciated.

I've found the following javascript as a starting point, but I'm not sure how to piece it together with my vf page to set the finish location.
function navigate (recordId){
			 
				if (typeof sforce !== 'undefined'){
					sforce.one.navigateToSObject(recordId);
				} else {
			        window.top.location.href= "/" + recordId;
			    }
			 
			}

Here's the vf page that hosts my flow:
<apex:page standardController="Opportunity">
<flow:interview name="MyBest" finishLocation= "{????}"> 
    <apex:param name="vAction" value="{!$CurrentPage.parameters.vAction}"/>
    <apex:param name="vUserID" value="{!$CurrentPage.parameters.vUserID}"/>    
    <apex:param name="vRecordID" value="{!$CurrentPage.parameters.vRecordID}"/>    
    <apex:param name="vObjectType" value="{!$CurrentPage.parameters.vObjectType}"/>
    
   </flow:interview> 
</apex:page>

 
  • June 17, 2016
  • Like
  • 1
Hello all,

I try to call a flow via a visualforce page. The flow is started from an Account (button and action), submitting the AccountID and simply creates a new object linked to this Accout. 
My goal is to go back to the Account page after the flow completed. It works in Salesforce classic, but not in Lighning and SF1. As soon as I click finish here, I am not redirected to the Account page, but the page just freezes. Only possibility is to click cancel then. 

Any suggestions from you?
Stefan

This is how my code looks like:

<apex:page standardController="Account">
<apex:variable var="getAccountId" value="{!Account.Id}"></apex:variable>
    <flow:interview name="Assessment" finishLocation="{!URLFOR('/'+getAccountId)}">
         <apex:param name="AccountID" value="{!Account.Id}"/>
    </flow:interview>
</apex:page>