Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

114
Visualizações
I am trying to pass values from HTML input into a JavaScript function and then to an apex controller to create a lead in salesforce
  • HTML (here is where I am collecting the information on an experience builder page)

             <div class="slds-form-element__control ">
            <input type="text"
             id="firstName"
             placeholder="First Name"
             class="first_name_input slds-input"
              />                 
             </div>
    
             <div class="slds-form-element__control ">
             <input type="text"
              id="lastName"
              placeholder="Last Name"
              class="last_name_input slds-input"
              />     
    
             </div>
    
             <div class="slds-form-element__control ">
             <input type="text"
              id="email"
              placeholder="Email Address"
              class="email_input slds-input"
              />                 
             </div>
    

-JavaScript (the values are passed to java script where there are multiple functions, this is the function that is designed to pass the values to apex for lead creation)

createLead(firstName,lastName, email) {
            var firstName = firstName
            var lastName = lastName
            var email = email
            this.createOrObtainExistingLead()
            this.navigateToFAPage()
            }

-Apex(once values are passed to the apex controller the lead should be created with values passed from JavaScript)

public class VOQuickQuoteController {

@AuraEnabled
@future
public static void createOrObtainExistingLead(string firstName, string lastName, string email,) {    
    
    Lead l = new Lead(
        firstName=firstName,
        lastName=lastName,
        email=email,       
    );
    insert l;    
}    

}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda