You need to sign in to do that
Don't have an account?
Akis Athanasiadis
Lightning component customization
I have created a lightning component that executes a screen flow which is running on "New".
How can I customize the layout of the lightning component?
For example, i want to have 2 columns and set specific fields insise these columns.
How can I customize the layout of the lightning component?
For example, i want to have 2 columns and set specific fields insise these columns.
Hi Akis,
Please use Lightning force:createRecord Form functionality to create records. Here is the documentation (https://trailhead.salesforce.com/en/content/learn/modules/lightning_app_builder/lightning_app_builder_recordpage)
Likewise, we have for force:editRecord.
However, if the requirement is to create custom logic that includes two fields then go with input-fields (https://developer.salesforce.com/docs/component-library/bundle/lightning-input-field/documentation). Documentation links attached.
Thanks,
Gaurav
Skype: gaurav62990
I mentioned layout not logic
Create an <Table> in Lightning Component with 2 <TR> and add your fields within this.
THanks,
Gaurav
In which one of these I type this code?
Additionally, as I may have multiple screens of fields displayed per screen, do I need to do something else or I put everything in there regardless the screen the field might appear?
Do all the Screen get values from the Same component? how are you controlling it? else, place these into multiple component where you want to display in the Screen.
Thanks,
Gaurav
Skype: gaurav62990
Everything runs through one flow. Accordin to the decision making throughout hte process, different fields and options will be displayed
Pass a parameter to Component so that it can identify which fields need to be displayed. Check particularly the "param1" or "param2" these are the apex variables.
Also, add these variables in the "Design" of the component.
Thanks
Gaurav
I have added in the first decision 2 fields as in one column. then i have created another TR where I put the other variable.
Is the logic correct?
Also how whould I pass this in the design?
- Create a aura:attribute for "Payment1" that is used in <aura:if>
- Pass this variable from Lightning Flow while calling the Aura:component.
- Add this attribute "payment1" on Design document for the lightning component. Chech this link (https://biernuage.com/2018/11/11/how-to-pass-input-value-from-lightning-flow-to-lightning-component/)
Thanks1) what I did above is correct?
2) if not what is incorrect?
3) in addition to this you mentioned that I need to add these variables in the design. What do I type there? Your last answer refers to the main component only.
- Create a aura:attribute for "Payment1" that is used in <aura:if>
and, this in Lightning Component Design document:- Add this attribute "payment1" on Design document for the lightning component. Check this link (https://biernuage.com/2018/11/11/how-to-pass-input-value-from-lightning-flow-to-lightning-component/)
and, while calling this Lightning component from Lightning Flow pass the value for Attribute "Payment1".Thats all.
Thanks
Also this is the design:
I assume that the label and the desctiption is not something of great importance here. Is that correct?
As for the "while calling this Lightning component from Lightning Flow pass the value for Attribute "XXX", I am missing that point.
I take all the input variables, I assign them on local ones?
How is this helping me out? I understand this might help in case of screen variables, that are not part of the fields - objects, and how I would like to present them in the component.
@Akis,
Absolutely, this looks good.
Now you have all the input variable from the Flow and the Design component ready. Just need to pass the value for label "New_Comsys_Asset" from the flow.
Now embed this component on the FLow. check this URL (https://www.jitendrazaa.com/blog/salesforce/embed-lightning-component-in-flow/)
You are all set to make it work just little changes as per the URL above.
Thanks,
Gaurav
Now open you flow screen, on the left side scroll to the bottom. You will find your Component name.
Thanks
I have done this through the action and I have set as input variable the recordId but still I do not see the layout that I have set
So, i followed the instructions from the URL as well
Still the layout is not working as expected. i get the same layout :(