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
Himanshu Patel 55Himanshu Patel 55 

Lightning Component: Java script button converted by SF Configurator tool


I have converted Java Script button through SF configurator and deployed it but not working in lightning. Below is the code. Not sure what's missing. 
<aura:component extends="c:LCC_GenericLightningComponent" >
    <aura:set attribute="partially" value="false"></aura:set>
    <aura:set attribute="isAdditionalObject" value="false"></aura:set>

    <!-- User Interface -->
        <div class="slds-scrollable slds-p-around_medium slds-text-heading_small" id="modal-content-id-1">
            <p class="slds-hyphenate"><a style="outline: 0;" href="" target="_blank">Sample Lightning Component Action</a></p>
        <footer class="slds-modal__footer">
            <lightning:button class="slds-button_brand" onclick="{!c.accept}" label="Accept"/>

    <!-- The height of the modal is defined in Salesforce, when you create the new action. -->
    <!-- Recommended height size: 250px -->
    accept : function(component, event, helper) {
	helperMethod : function() {
Java Script Button from Classic
//This code allows for the JS SOQL calls {!Account.Include_in_Retailer_Search__c}
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")} 

//Select the current Contact records and put it into the record variable 
var records = sforce.connection.query("SELECT Id, Agreement_Sent__c FROM Account Where id= '{!Account.Id}'"); 
var contactRec = records.getArray('records')[0]; 

//JS sees the number field as a string so this will make sure that 
//is a number - Number(contactRec.Emails_sent_count__c) 
contactRec.Agreement_Sent__c= Number(contactRec.Agreement_Sent__c) + 1; 

//Update contactRec object 

//Reload the page 

SwethaSwetha (Salesforce Developers) 
HI Himanshu,
By not working are you seeing any errors?
Himanshu Patel 55Himanshu Patel 55
Hi Swetha, 

I am not getting any error when clicking on the button but it's not doing what needs to be done.

When i click on it, message appears as 'Sample Lightning Component Action' than only button named as 'Accept'