You need to sign in to do that
Don't have an account?

Disable the javascript button after it clicked once
Hi ,
I have written a javascript button to create a record on salesforce .when the user clicks once on the button the record is created .but he clicks again on the button another record is created.
I just dont want the user to click the button again and create a duplicate record.Is there any other way to disable the button after the user clicks once or else if the record is already created .he needs to be prompted that the record is already exixts.
I have written a javascript button to create a record on salesforce .when the user clicks once on the button the record is created .but he clicks again on the button another record is created.
I just dont want the user to click the button again and create a duplicate record.Is there any other way to disable the button after the user clicks once or else if the record is already created .he needs to be prompted that the record is already exixts.
{!requireScript("/soap/ajax/26.0/connection.js")} var req = new sforce.SObject("Candidate__c"); req.Id = "{!Candidate__c.Id}"; req.Job_Application__c="True"; req.Recruiting_Status__c="Possible Candidate" var aResult = sforce.connection.update([req]); if (aResult[0].getBoolean("success")) { console.log("Candidate Update Successful"); } var newJob = new sforce.SObject("Job_Application__c"); newJob.Candidate__c= "{!Candidate__c.Id}"; newJob.Position__c= "{!Candidate__c.PositionId__c}"; newJob.Status__c="open"; var cResult = sforce.connection.create([newJob]); if ( cResult[0].getBoolean( "success" ) ) { alert("Candidate Created Sucessfully "); window.location.reload(); } else { alert( cResult[0].errors.message); }
Use this, if any prblm whats app me +642206205059 that's easy
All Answers
you can use render operation and try to write some code for render function that once is created the button is hidden like that.
Thank You
I am getting the following error after implementing the code can you please help me to resolve the issue
("select Candidate__c from Job_Application__c Where Candidate__c =: " '+candidateiD+' " LIMIT 1"):
please use this query instead.
Use this, if any prblm whats app me +642206205059 that's easy
Thanks vivek.
Do you any ideas how to achive this feature in salesforce .. please share you ideas on this funtionality
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000D6pjIAC
Thanks
Praveen