Should I use Javascript Classes or Apex Classes in Lightning Web Components? [on hold] Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) 2019 Community Moderator Election ResultsWant to create select option from ApexAssign value of one field to other field of same object of selected list by clicking a button in list view of objectrepeat rendered for certain conditionHow do I transform SOQL result and output to PageBlockTable?FATAL_ERROR|System.QueryException: List has no rows for assignment to SObjectSLDS classes on (new) base Lightning web components don't workLightning Web Component for table rows and cellsIs there a way to load every label data and every SObject description data in Lightning Web Component using only Javascript without any Apex?When do @wire methods run (LWC)?Calling apex imperative method in lightning web component needs two click to show data

Where did Ptolemy compare the Earth to the distance of fixed stars?

Vertical ranges of Column Plots in 12

First paper to introduce the "principal-agent problem"

By what mechanism was the 2017 UK General Election called?

Fit odd number of triplets in a measure?

How to make triangles with rounded sides and corners? (squircle with 3 sides)

Why do C and C++ allow the expression (int) + 4*5;

How do Java 8 default methods hеlp with lambdas?

Problem with display of presentation

My mentor says to set image to Fine instead of RAW — how is this different from JPG?

3D Masyu - A Die

How to ask rejected full-time candidates to apply to teach individual courses?

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

Random body shuffle every night—can we still function?

What are some likely causes to domain member PC losing contact to domain controller?

.bashrc alias for a command with fixed second parameter

2018 MacBook Pro won't let me install macOS High Sierra 10.13 from USB installer

Does the universe have a fixed centre of mass?

Sally's older brother

Adapting the Chinese Remainder Theorem (CRT) for integers to polynomials

Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?

The Nth Gryphon Number

Did any compiler fully use 80-bit floating point?

malloc in main() or malloc in another function: allocating memory for a struct and its members



Should I use Javascript Classes or Apex Classes in Lightning Web Components? [on hold]



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
2019 Community Moderator Election ResultsWant to create select option from ApexAssign value of one field to other field of same object of selected list by clicking a button in list view of objectrepeat rendered for certain conditionHow do I transform SOQL result and output to PageBlockTable?FATAL_ERROR|System.QueryException: List has no rows for assignment to SObjectSLDS classes on (new) base Lightning web components don't workLightning Web Component for table rows and cellsIs there a way to load every label data and every SObject description data in Lightning Web Component using only Javascript without any Apex?When do @wire methods run (LWC)?Calling apex imperative method in lightning web component needs two click to show data



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















I am working on designing a timesheet Lightning Web Component for my company. Internally, we use a sObject that tracks individual sessions, which then gets rolled up one way to generate payroll, and another way to create invoices. To that end, we don't have a timesheet sObject in our schema (we do have a paystub sObject, but we run payroll every two weeks and collect timesheets every week).



The general flow of what needs to happen is run a SOQL query, transform the data into rows (clients) and columns (dates), and then display the data for viewing and editing. The SOQL clearly happens in an Apex class, and the display is clearly happening in an LWC, but I am unclear about the transformation stage. Would it make sense to have an Apex class gather all the data, transform it, and then @wire the data to the LWC row by row? Or should I just use the Apex class to generate all of the data, @wire a list to the LWC, and use Javascript objects to sort everything into rows and columns?










share|improve this question







New contributor




Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as primarily opinion-based by Jayant Das, Sebastian Kessel, Reshma, Pranay Jaiswal, Raul Apr 18 at 5:44


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 1





    If I had to design this, I would have created a wrapper class to collect all data within the Apex and then return the List<MyWrapperClass> to the LWC. This way I would keep all the logic of fetching/transforming/saving data consolidated at one place.

    – Jayant Das
    Apr 15 at 18:06

















6















I am working on designing a timesheet Lightning Web Component for my company. Internally, we use a sObject that tracks individual sessions, which then gets rolled up one way to generate payroll, and another way to create invoices. To that end, we don't have a timesheet sObject in our schema (we do have a paystub sObject, but we run payroll every two weeks and collect timesheets every week).



The general flow of what needs to happen is run a SOQL query, transform the data into rows (clients) and columns (dates), and then display the data for viewing and editing. The SOQL clearly happens in an Apex class, and the display is clearly happening in an LWC, but I am unclear about the transformation stage. Would it make sense to have an Apex class gather all the data, transform it, and then @wire the data to the LWC row by row? Or should I just use the Apex class to generate all of the data, @wire a list to the LWC, and use Javascript objects to sort everything into rows and columns?










share|improve this question







New contributor




Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as primarily opinion-based by Jayant Das, Sebastian Kessel, Reshma, Pranay Jaiswal, Raul Apr 18 at 5:44


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.













  • 1





    If I had to design this, I would have created a wrapper class to collect all data within the Apex and then return the List<MyWrapperClass> to the LWC. This way I would keep all the logic of fetching/transforming/saving data consolidated at one place.

    – Jayant Das
    Apr 15 at 18:06













6












6








6








I am working on designing a timesheet Lightning Web Component for my company. Internally, we use a sObject that tracks individual sessions, which then gets rolled up one way to generate payroll, and another way to create invoices. To that end, we don't have a timesheet sObject in our schema (we do have a paystub sObject, but we run payroll every two weeks and collect timesheets every week).



The general flow of what needs to happen is run a SOQL query, transform the data into rows (clients) and columns (dates), and then display the data for viewing and editing. The SOQL clearly happens in an Apex class, and the display is clearly happening in an LWC, but I am unclear about the transformation stage. Would it make sense to have an Apex class gather all the data, transform it, and then @wire the data to the LWC row by row? Or should I just use the Apex class to generate all of the data, @wire a list to the LWC, and use Javascript objects to sort everything into rows and columns?










share|improve this question







New contributor




Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am working on designing a timesheet Lightning Web Component for my company. Internally, we use a sObject that tracks individual sessions, which then gets rolled up one way to generate payroll, and another way to create invoices. To that end, we don't have a timesheet sObject in our schema (we do have a paystub sObject, but we run payroll every two weeks and collect timesheets every week).



The general flow of what needs to happen is run a SOQL query, transform the data into rows (clients) and columns (dates), and then display the data for viewing and editing. The SOQL clearly happens in an Apex class, and the display is clearly happening in an LWC, but I am unclear about the transformation stage. Would it make sense to have an Apex class gather all the data, transform it, and then @wire the data to the LWC row by row? Or should I just use the Apex class to generate all of the data, @wire a list to the LWC, and use Javascript objects to sort everything into rows and columns?







apex soql lightning-web-components






share|improve this question







New contributor




Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 15 at 18:00









Andrew FavaloroAndrew Favaloro

333




333




New contributor




Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Andrew Favaloro is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as primarily opinion-based by Jayant Das, Sebastian Kessel, Reshma, Pranay Jaiswal, Raul Apr 18 at 5:44


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.









put on hold as primarily opinion-based by Jayant Das, Sebastian Kessel, Reshma, Pranay Jaiswal, Raul Apr 18 at 5:44


Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1





    If I had to design this, I would have created a wrapper class to collect all data within the Apex and then return the List<MyWrapperClass> to the LWC. This way I would keep all the logic of fetching/transforming/saving data consolidated at one place.

    – Jayant Das
    Apr 15 at 18:06












  • 1





    If I had to design this, I would have created a wrapper class to collect all data within the Apex and then return the List<MyWrapperClass> to the LWC. This way I would keep all the logic of fetching/transforming/saving data consolidated at one place.

    – Jayant Das
    Apr 15 at 18:06







1




1





If I had to design this, I would have created a wrapper class to collect all data within the Apex and then return the List<MyWrapperClass> to the LWC. This way I would keep all the logic of fetching/transforming/saving data consolidated at one place.

– Jayant Das
Apr 15 at 18:06





If I had to design this, I would have created a wrapper class to collect all data within the Apex and then return the List<MyWrapperClass> to the LWC. This way I would keep all the logic of fetching/transforming/saving data consolidated at one place.

– Jayant Das
Apr 15 at 18:06










1 Answer
1






active

oldest

votes


















5














Unless the transformation significantly reduces the amount of data you have to send from the server to the client, it most likely makes sense to do as much as possible in the client (JavaScript). JavaScript is far more efficient in CPU time than Apex, so you'll reduce the overall time the user has to wait for the results to appear. Also, if you decide you later want to provide different options (filtering, sorting, etc), you can avoid network activity entirely by using JavaScript as much as possible, allowing near-instant updates to the page.






share|improve this answer


















  • 1





    Adding color to this discussion: ES6 .map(), .filter() and .reduce() significantly improve UX at the expense of server-side reusability. You can still offload any helpers to a LWC utils file and find client-side reusability there.

    – tsalb
    Apr 15 at 20:22











  • I know that the LWC framework is built on top of ES5, how much of ES6 is available/unavailable?

    – Andrew Favaloro
    Apr 16 at 14:08











  • @AndrewFavaloro this doc goes in to detail, but essentially, all of ES6 and ES7, most of ES8, and some of ES9.

    – sfdcfox
    Apr 16 at 14:24

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














Unless the transformation significantly reduces the amount of data you have to send from the server to the client, it most likely makes sense to do as much as possible in the client (JavaScript). JavaScript is far more efficient in CPU time than Apex, so you'll reduce the overall time the user has to wait for the results to appear. Also, if you decide you later want to provide different options (filtering, sorting, etc), you can avoid network activity entirely by using JavaScript as much as possible, allowing near-instant updates to the page.






share|improve this answer


















  • 1





    Adding color to this discussion: ES6 .map(), .filter() and .reduce() significantly improve UX at the expense of server-side reusability. You can still offload any helpers to a LWC utils file and find client-side reusability there.

    – tsalb
    Apr 15 at 20:22











  • I know that the LWC framework is built on top of ES5, how much of ES6 is available/unavailable?

    – Andrew Favaloro
    Apr 16 at 14:08











  • @AndrewFavaloro this doc goes in to detail, but essentially, all of ES6 and ES7, most of ES8, and some of ES9.

    – sfdcfox
    Apr 16 at 14:24















5














Unless the transformation significantly reduces the amount of data you have to send from the server to the client, it most likely makes sense to do as much as possible in the client (JavaScript). JavaScript is far more efficient in CPU time than Apex, so you'll reduce the overall time the user has to wait for the results to appear. Also, if you decide you later want to provide different options (filtering, sorting, etc), you can avoid network activity entirely by using JavaScript as much as possible, allowing near-instant updates to the page.






share|improve this answer


















  • 1





    Adding color to this discussion: ES6 .map(), .filter() and .reduce() significantly improve UX at the expense of server-side reusability. You can still offload any helpers to a LWC utils file and find client-side reusability there.

    – tsalb
    Apr 15 at 20:22











  • I know that the LWC framework is built on top of ES5, how much of ES6 is available/unavailable?

    – Andrew Favaloro
    Apr 16 at 14:08











  • @AndrewFavaloro this doc goes in to detail, but essentially, all of ES6 and ES7, most of ES8, and some of ES9.

    – sfdcfox
    Apr 16 at 14:24













5












5








5







Unless the transformation significantly reduces the amount of data you have to send from the server to the client, it most likely makes sense to do as much as possible in the client (JavaScript). JavaScript is far more efficient in CPU time than Apex, so you'll reduce the overall time the user has to wait for the results to appear. Also, if you decide you later want to provide different options (filtering, sorting, etc), you can avoid network activity entirely by using JavaScript as much as possible, allowing near-instant updates to the page.






share|improve this answer













Unless the transformation significantly reduces the amount of data you have to send from the server to the client, it most likely makes sense to do as much as possible in the client (JavaScript). JavaScript is far more efficient in CPU time than Apex, so you'll reduce the overall time the user has to wait for the results to appear. Also, if you decide you later want to provide different options (filtering, sorting, etc), you can avoid network activity entirely by using JavaScript as much as possible, allowing near-instant updates to the page.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 15 at 18:14









sfdcfoxsfdcfox

266k13212459




266k13212459







  • 1





    Adding color to this discussion: ES6 .map(), .filter() and .reduce() significantly improve UX at the expense of server-side reusability. You can still offload any helpers to a LWC utils file and find client-side reusability there.

    – tsalb
    Apr 15 at 20:22











  • I know that the LWC framework is built on top of ES5, how much of ES6 is available/unavailable?

    – Andrew Favaloro
    Apr 16 at 14:08











  • @AndrewFavaloro this doc goes in to detail, but essentially, all of ES6 and ES7, most of ES8, and some of ES9.

    – sfdcfox
    Apr 16 at 14:24












  • 1





    Adding color to this discussion: ES6 .map(), .filter() and .reduce() significantly improve UX at the expense of server-side reusability. You can still offload any helpers to a LWC utils file and find client-side reusability there.

    – tsalb
    Apr 15 at 20:22











  • I know that the LWC framework is built on top of ES5, how much of ES6 is available/unavailable?

    – Andrew Favaloro
    Apr 16 at 14:08











  • @AndrewFavaloro this doc goes in to detail, but essentially, all of ES6 and ES7, most of ES8, and some of ES9.

    – sfdcfox
    Apr 16 at 14:24







1




1





Adding color to this discussion: ES6 .map(), .filter() and .reduce() significantly improve UX at the expense of server-side reusability. You can still offload any helpers to a LWC utils file and find client-side reusability there.

– tsalb
Apr 15 at 20:22





Adding color to this discussion: ES6 .map(), .filter() and .reduce() significantly improve UX at the expense of server-side reusability. You can still offload any helpers to a LWC utils file and find client-side reusability there.

– tsalb
Apr 15 at 20:22













I know that the LWC framework is built on top of ES5, how much of ES6 is available/unavailable?

– Andrew Favaloro
Apr 16 at 14:08





I know that the LWC framework is built on top of ES5, how much of ES6 is available/unavailable?

– Andrew Favaloro
Apr 16 at 14:08













@AndrewFavaloro this doc goes in to detail, but essentially, all of ES6 and ES7, most of ES8, and some of ES9.

– sfdcfox
Apr 16 at 14:24





@AndrewFavaloro this doc goes in to detail, but essentially, all of ES6 and ES7, most of ES8, and some of ES9.

– sfdcfox
Apr 16 at 14:24



Popular posts from this blog

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020