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;
}
}
}