Skip to main content
I have account Detail Page custom button and Content Source is visual force page in the Button Setup.

VF page is used to call a controller method to execute and create Record in ERP system using REST API.

<apex:page standardcontroller="Account" extensions="CreateCustomerController" action="{!createCustomer}">

</apex:page>

When user double clicks it is creating duplicate customer records in our ERP system.

How can I prevent this happening.? 

Can I disable the button after first click? 

If you have asome other solution I can try. I have seen some post like below but I am using VF page as content source so don't want use this.

https://developer.salesforce.com/forums/?id=906F000000093GUIAY

 
2 个回答
  1. 2015年11月4日 03:11

    You can use Status as well, which will show a loding UI but I don't think it will prevent clicking the link again. In general practice we use YUI Loading which again shows a loding UI but disable the complete background page, that will probably prevent the double click on link. 

     

    Hope this will help as an example : https://developer.salesforce.com/page/Visualforce_blog

0/9000