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
RaoSRaoS 

display records from a custom object after adding them by clicking a "Add" button in Lightning

Hi ,
I have a input text field to type in a input value and a custom button "Add" to add these records to a custom object.  After adding the record the record should be displayed immediately on the same page.
If I add 5 records all the 5 records should be displayed after the Add button.  If I add a 6th record now this record should be visible after the 5th record.

How to accomplish this?

Thanks
Rao
 
GarryPGarryP

1. create a Attribute of List of sobject

2. yo can use force:createRecord event to create record and once the record is saved add it to list at #1 
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_createRecord.htm
3. Display the list at #1 whereevr you want the list of records to be show.
4. user auraIteration to display records in the list

Ashif KhanAshif Khan
Hi Rao,

this is the trailhead expense list module which works similar to your requirement 
https://trailhead.salesforce.com/en/modules/lex_dev_lc_basics

I hope this will help you 
Regard
Ashif