Salesforce custom button call VF page with extension

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Hello:
I am trying to call a skuid page using a custom button on the account object:
<apex:page
standardController="Account" extensions="skuid.Redirects" action="{!redirect}&page=MySkuidPage"> 
</apex:page>


The issue isthe existing VF page look like this:
<apex:page standardstylesheets="true" showheader="false" standardController="Account" extensions="SomeController">

How do I call the Skuid page when a Controller need to be called?

Thanks,
Michael
Photo of Michael

Michael

  • 202 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
You need to use the "skuid:page" Visualforce component method of invoking Skuid, as opposed to the "Redirect" method.

See this tutorial for more details:

https://docs.skuid.com/v10.0.4/en/skuid/deploy/salesforce/visualforce/skuid-page-visualforce-compone...
Photo of Michael

Michael

  • 202 Points 100 badge 2x thumb
Thanks Zach.
Photo of Michael

Michael

  • 202 Points 100 badge 2x thumb
Hey Zach,
Where do you reference the Skuid page in the VF syntax?<apex:page
  standardController="Account"
  extensions="skuid.Redirects,MyController"
  showHeader="true"
  sidebar="false"
  readonly="true"
  docType="html-5.0"
  action="{!IF(canUseSkuid,'',redirect)}"
  title="New {!$ObjectType.Account.label}">
    <skuid:page objectType="Account" actionType="New" /> 
</apex:page>


Thanks
M
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,422 Points 20k badge 2x thumb
Can you explain what you mean by "initiate a call from a Salesforce Button"? You are doing this from within a Skuid Page, correct?
Photo of Michael

Michael

  • 202 Points 100 badge 2x thumb
Yes.  But I need a way for the user to initiate the request from an Account record.
Thanks,
M
Photo of Matt Sones

Matt Sones, Champion

  • 31,412 Points 20k badge 2x thumb
As far as I've understood, you should be able to just query the skuid model that you've built on your REST service.
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,422 Points 20k badge 2x thumb
Sorry if I'm having trouble pinpointing exactly what you're trying to do, are you saying that you are trying to take the user to your Skuid Page from a Salesforce custom button that's on a standard Salesforce Account record detail page? If that's the case, you just need to have the Custom Button navigate the User to your Visualforce Page, e.g. with something like this:


The Id of the context account record will automatically be sent in the URL.

NOTE: In order for your Visualforce Page to appear in the dropdown of Visualforce Pages here, it will need to have standardController="Account" .

Is this what you're trying to do??
Photo of Michael

Michael

  • 202 Points 100 badge 2x thumb
Totally over complicated this.  here is the VF page that resides on the Account page. Thanks for all your help Zach. 

<apex:page
  standardController="Account"
  extensions="skuid.Redirects"
  action="{!redirect}&page=SkuidPage">
</apex:page>