You need to sign in to do that
Don't have an account?
HNT_Neo
Lightning Event Handler for New Lead JavaScript
Hey all,
Need your help and thank you in advance.
Trying to create a lightning component that would invoke the New Lead Event action. For example from Lightning Experience in Winter 17, when you click the Lead tab, the +New Lead when pressed will call the New Lead popup window.
I'm looking for the lightning component syntax that would call the Lead's event handler when the end user presses a button on a lightning component (CREATE).
I'm on a deadline to have 6 of these types created by tomorrow :( but if I can get an idea of what the aura component syntax would look like or the code that would fire this, I can create the rest of the buttons I need.
I know I'm close of where the information I need may be at, but missing the component and client-side controller source.
The Lightning Components Developer Guide (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_example.htm ) has some syntax that I think is the one:
and would only need the correct name at .handleClick (i'm guessing, Lead in this case, I'll try after I post this if someone doesn't beat me to it).
Thank you!
Need your help and thank you in advance.
Trying to create a lightning component that would invoke the New Lead Event action. For example from Lightning Experience in Winter 17, when you click the Lead tab, the +New Lead when pressed will call the New Lead popup window.
I'm looking for the lightning component syntax that would call the Lead's event handler when the end user presses a button on a lightning component (CREATE).
I'm on a deadline to have 6 of these types created by tomorrow :( but if I can get an idea of what the aura component syntax would look like or the code that would fire this, I can create the rest of the buttons I need.
I know I'm close of where the information I need may be at, but missing the component and client-side controller source.
The Lightning Components Developer Guide (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/events_component_example.htm ) has some syntax that I think is the one:
<!--c:ceNotifier--> <aura:component> <aura:registerEvent name="cmpEvent" type="c:ceEvent"/> <h1>Simple Component Event Sample</h1> <p><ui:button label="Click here to fire a component event" press="{!c.fireComponentEvent}" /> </p> </aura:component>OR
<aura:component> <aura:attribute name="text" type="String" default="Just a string. Waiting for change."/> <input type="button" value="Flawed HTML Button" onclick="alert('this will not work')"/> <br/> <ui:button label="Framework Button" press="{!c.handleClick}"/> <br/> {!v.text} </aura:component>
and would only need the correct name at .handleClick (i'm guessing, Lead in this case, I'll try after I post this if someone doesn't beat me to it).
Thank you!
Do not put anything in helper class and your controller class will look like this :
All Answers
To call new Lead craete Popup from your lightning component simply create a button on the component
and in JS use following code:
To edit a record in popup window use following syntax:
If you're satisfied with the answers provided, please don't forget to select a Best Answer.
Thanks!
Does the JS go into the HELPER ?
Where the edit record popup syntax go?
Thanks!
Add the component where ever you want , on detail page of record, on list view etc.
but keep receiving an error (see attached)
Do not put anything in helper class and your controller class will look like this :
Remove attribute from the Component and try saving:
<aura:component >
<div class="container">
<aura:attribute name="lead" type="Lead"default="{ 'sobjectType': 'Lead'}"/>
<ui:button label="Framework Button" onclick="{!c.createRecord}" />
</div>
</aura:component>
Thanks
and component saves.
I will test now and let you know.
You need to make the compoent available in community builder and global , add this to component
Here's what i get:
How do I get it to render the record types though? For example, I have 5 Lead Record Types and the button created only renders a new lead page. Thank you!