2

I am currently having an issue with my custom passthrough page where it operates correctly but, only when it is outside the service console.

So when I am in the service console, any redirect functionality (filling URL values before going to a custom VisualForce page) no longer works.

So my question is, has anyone run into this issue? If so, how did you manage to resolve it?

I have tried researching it but, haven't found any actual solutions to solve the problem online.

Passthrough Controller Code
Note: I altered the code slightly, not to reveal anything comromising


public with sharing class MyPassthroughController 
{
    private ApexPages.StandardController CurrentStandardController { get; set; }
    private sObject CurrentsObject { get; set; }
    private final Set RecordTypesSet { get; set; }

     public MyPassthroughController (ApexPages.StandardController ControllerToExtend)
     {
        this.CurrentStandardController = ControllerToExtend;   
        this.CurrentsObject = (Example)this.CurrentStandardController.getRecord();

        this.RecordTypesSet = Utilility.RetrieveRecordTypeIdSet('RecordType One;RecordType Two', Schema.sObjectType.Example); 
    }

    public PageReference RedirectByRecordType()
    {
        String ExamplesObjectPrefix = Schema.sObjectType.Example.getKeyPrefix();
        PageReference CorrectRedirectionPage = new PageReference('/' + ExamplesObjectPrefix + '/e?nooverride=1&RecordType=' + this.CurrentsObject.RecordTypeId);

        List Parameters = new List();
        String ReturnURL = ApexPages.currentPage().getParameters().get('retURL');

         if(String.isNotEmpty(ReturnURL))
                Parameters.add( 'retURL=' + ReturnURL);

        if(this.CurrentsObject.Id == null)
        {
            Parameters.add( 'RecordTypeId=' + this.CurrentsObject.RecordTypeId);

            if(this.RecordTypesSet.contains(this.CurrentsObject.RecordTypeId))
                CorrectRedirectionPage = new PageReference( '/apex/CustomEditPage?' + String.join(Parameters, '&'));
        }
        else
            if(this.RecordTypesSet.contains(this.CurrentsObject.RecordTypeId))
              CorrectRedirectionPage = new PageReference( '/apex/CustomEditPage?id=' + this.CurrentsObject.Id);

        return CorrectRedirectionPage;
    }
}

Actual Page Doing Redirect

<apex:page standardController="Example"  showHeader="false" sidebar="false" extensions="MyPassthroughController" action="{!RedirectByRecordType}">
</apex:page>

Hope this code helps clarify things.

Update

Now I am getting a different error that makes more sense.

Now it looks like security is the issue. This is due to only custom VisualForce pages not displaying with the 'This content cannot be displayed in a frame' message

I am getting the dreaded 'This content cannot be displayed in a frame' message. When I choose to 'Open this content in a new window' the correct page opens. So, I am making a little more progress.
Also, I updated the custom URL with URL.getSalesforceBaseUrl().toExternalForm() + '/apex/CustomEditPage?id=' + this.CurrentsObject.Id

6
  • What does the page and the controller look like? How is the redirect formatted. In the Service console, you need to use the integration toolkit to open new tabs, are you accounting for that? – JimRae May 21 '14 at 15:42
  • I added some example code. But I have not taken into account the integration toolkit. I am unfamiliar with how to utilize that. – Programmable Medley May 21 '14 at 15:59
  • 1
    I wonder if this known issue is related: success.salesforce.com/issues_view?id=a1p30000000T0xnAAC – Daniel Hoechst May 21 '14 at 18:38
  • I believe this is very similar. However, since it is not a button but a passthrough, I'm curious if adding the location.serach is possible. But this gives me something to go on. – Programmable Medley May 21 '14 at 19:43
  • Have you tried to redirect to the full URL, not just /apex/Page ? – Sergej Utko May 22 '14 at 14:53
2

This will always happen with VF in the service console.

The workaround I have found is to use a component instead of a VF page. The downside is you will lose the standard controller functionality, but you can always pass in the record in question and any other attributes using attributes.

Also, another thing to note is to undersatnd if your VF/Component is going to be used in both Service Console and non-service console scenarios, in which case you will need to use the force console integration toolkit to open any links in your page as tabs vs taking over the screen (as is normal functionality)

0

Now that I identified it as a security issue, I decided to disable the clickjacking security setting. In doing so, all pages that were redirected by the passthrough worked.

To do this, I simply found the Secutiry Controls and went to Session Settings, finding this:

Enable clickjack protection for non-setup customer Visualforce pages

The only downside is I do not believe this will be an acceptable solution due to security concerns. So I may be searching for a work-around in the future - if that is at all possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.