After doing some testing, I can say that this is very inefficient. Loading more than about 6 records caused a separate loading to occur. While the system did not crash, as I hypothesized originally in my comment, the total loading time was incredibly large. For about 800 records, it took over 20 seconds to load, about 40 records per second. And this was for a field specified by the fields attribute. This is opposed to my PagingSortingDemo, which loads about 52,770 records with 4 fields in three seconds, or about 17,500 records per second, a total increase in speed of about 43,900%.
The moral of the story is that you should only use Lightning Data Service to load one record at a time. Similarly, if you're going to choose to save data, make a list and save them all at once. Lightning Data Service is ideal for things like Quick Actions that update or query the related record (and with even better performance when using the cache). It is not ideal for bulk loading or saving of data.
Hopefully, they'll introduce a bulk-friendly option for both loading and saving data in the future. For now, you should prefer to use Apex Code whenever you need to upload more than a few records at a time.
An ES6 module is a JavaScript file that explicitly exports variables
or functions that other modules can use. Modules make it easier to
structure your code without polluting the global scope.
Everything in LWC which is imported and Exported is a ES6 module.
JavaScript files in Lightning web components are ES6 modules. By
default, everything declared in a module is local—it’s scoped to the
module.
As this is basically es6 and not just LWC, I tried searching import all from es6
.
Surprisingly, there are many results, I tried a solution from most accepted and most voted answer that suggested exporting * first and then importing it in new component.
My code which exports all lables in AllLables
module
import { LightningElement } from 'lwc';
export * from '@salesforce/label';
export default class AllLables extends LightningElement {
}
when I try saving it, I get this error:
LWC1507: Exporting * from @salesforce/label is not allowed.
Apparently, even if there is the way in ES6, SF is intentionally blocking it, probably for the same reason it does not allow SELECT * in SOQL
You have to use Apex :(
Best Answer
No.
LDS - lightning/uiRecordApi, lightning-record-form, lightning-record-edit-form and lightning-record-view-form - are all based for only 1 record .
For simplicity you can write custom apex utils method which accepts parameters like list of fields, object name, query filters etc which can return both SOQL or SOSL query results.
This can be a starting point for creating such method .