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
Uttam Kavitkar 4Uttam Kavitkar 4 

How to handle quick action save button event while using custom VF Page?

Hi All,

I have created 'New Action' on Custom object 'class__C' and assign custom VF page in Action type. I need to handle Quick Action's Save button event in my custom visualforce page. The page pops up as a modal containing save button.
How to handle 'Save' button event of modal pop up in lightning experience?? 

User-added image
Gangadhar NandiniGangadhar Nandini
Try using the following script in the Visualforce Page.
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'></script> <script> // Activate 'Save button' when the panel shows up Sfdc.canvas.publisher.subscribe({name: "publisher.showPanel", onData:function(e) { Sfdc.canvas.publisher.publish({name:"publisher.setValidForSubmit", payload:"true"}); }}); // Subscribe to the Save button to influence cusotm logi Sfdc.canvas.publisher.subscribe({ name: "publisher.post", onData: function(e) { //**TODO** // Do whatever you want to do here when the user clicks save button //** END TODO** // Gracefully close the popup when user taps save Sfdc.canvas.publisher.publish({ name: "publisher.close", payload:{ refresh:"true" }}); }}); </script>
Gayatri Keshkamat 10Gayatri Keshkamat 10
@Gangadhar Nandini, thanks for this solution.
Chethan SNChethan SN
hi ,
@Gangadhar Nandini    I have done the same thing in my code. 
It is working in one of the instance but not in another. Save button in grayed out like in the first screen shot shared by Uttam. 
Can you suggest something on this please ? 

Thanks ,
Chethan.S.N
Madhav GoyalMadhav Goyal
Hi, 

Did anyone get the solution for this? I want to add additional functionality on Save Button, how this can be achived?