Skip to main content

Hi, we’re trying to customize when Skuid is displayed on detail pages for one of our custom objects. The goal is to redirect some specific users to another page (not the SF Classic page) before seeing the Skuid page.


The issue is that whenever I try to save the VF page below, I get the error “Unknown property ‘My_Custom_Object__cStandardController.myRedirectMethod’”


It seems like I’ve setup the page exactly as it should be, but nothing I’ve tried seems to work. Has anyone had any experience customizing this page?


Another option I tried was calling skuid.Redirects.redirect or skuid.Redirects.canUseSkuid from my class, but I always got either ‘Non static method cannot be referenced from a static context: System.PageReference skuid.Redirects.redirect()’ or ‘Method does not exist or incorrect signature: void canUseSkuid() from the type skuid.Redirects’ respectively.


We’re on 12.8.4, API version 1.


Here’s the code:


// Skuid_My_Custom_Object_View.page
<apex:page standardController="My_Custom_Object__c" extensions="MyCustomClass, skuid.Redirects"
showHeader="true" sidebar="false" readonly="true" docType="html-5.0"
action="{!IF(canUseSkuid,myRedirectMethod,redirect)}" title="My Page">
<skuid:page objectType="My_Custom_Object__c" actionType="View" />
</apex:page>


// MyCustomClass__c.apex
public with sharing class MyCustomClass {

private Boolean doMyRedirect;

public MyCustomClass(ApexPages.StandardController controller) {
// check my redirect logic here
doMyRedirect = false;
}

public PageReference myRedirectMethod() {
if(doMyRedirect) {
Pagereference myPage = new Pagereference('https://www.example.com');
myPage.setRedirect(true);
return myPage;
} else {
return null;
}
}
}

Hey @Evan_McDaniel, and welcome back 😃!


I’m looking into this now, and I will ping you once I have a solution.


Cheers,


Evan - this may be insulting. I really haven’t even read thoroughly through your code. But I wonder if you have explored Skuid Page Assignments for this scenario. They are under the “Deploy” tab in the Skuid App. They allow you to choose various skuid pages for various users, profiles, record types or scenarios.


Here is the doc: Page Assignments — Skuid v15.1.6 Documentation


Hey Rob, just back from a week off and reading your response now. Yeah, we are using Page Assignments, but need a bit more granularity based on some custom requirements on our side (some people that have been assigned to Skuid via Page Assignments need to be redirected somewhere else first).


Any other thoughts on how we might achieve this?


Thanks.


Well - page assignments can be created that target individual users. Its not the normal way we see them work, but if you have one off scenarios for a handful of users - it might be a good “non code” way to go.


Hi Rob,


Yeah, we are very much aware of how Page Assignments work, but want to introduce a step before we get to the Page Assignments step.


For example, let’s say we have new team members that we need to sign a disclosure before accessing our Skuid page, we need to first redirect them to the custom page. Once on the page, there is a link to get back to the actual page they came from which would then go into whether or not they get Skuid based on Page Assignments.


Hey @Evan_McDaniel,


Are you still having issues with creating a redirect for new users? If so, can you send me a simplified XML of your project to see how we can solve that user condition? I feel we can do this declaratively, but not would need first to piece everything together to get a better grasp.


Thanks!


Reply