function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Fabio PalladinoFabio Palladino 

Custom Action with not rendered VF page

Hi All,
I need to create a custom action for LEX environment placed in a detail page of custom Object.
This action must execute a JS remote invocation to an apex class that update one field on record in context.
After this the record must be refreshed and new value of custom field displayed.
I have created:
  • An Apex controller extension for custom Object that performs field update on the record visualized (@remote method) 
  • A VF page that embed JS remote invocation to Apex method
  • A custom Action of type "Custom Visualforce"
I added the action on Object Page Layout and It works but when I click on the button I visualize, for a few seconds, a blank popup page like this:
Blank VF page

I don't need to visualize any Grafical VF page I only need to perform JS invocation.
This is VF page:
<apex:page standardController="Quote__c" extensions="Test4SyncController" docType="html-5.0" standardStylesheets="false" showheader="false" sidebar="false">

<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script>

function UpdateAccount(){
    aId = '<apex:outputText value="{!Quote__c.Id}"/>';
    Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.Test4SyncController.updateAccount}', aId,
                                              function(result, event){;
                                                                          // Success - close the publisher and refresh the feed.
                                                                          Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ refresh:"true"}});  
                                                                      } else if (event.type === 'exception'){
                                                                      } else {



You know any way to perform this requirement ?

Thanks in advance for your reply
Since you're using LEX, you might want to consider using a Lightning Component that makes a callout to an @AuraEnabled Apex method. This Component would be held in a Visualforce page using Lightning Out. There's a blog about how to do this here. (