Recent Items - Custom Lightning component
Here comes the another #Salesforce custom lightning component blog post. With this custom lightning components its easy to get the recent items of an object with dynamic fields and also it allows to limit the number of recent records you want to display in the page. This simple lightning component UI is designed with the salesforce lightning design system
Let's get into the details, The recently viewed records of the current user are stored in the RecentlyViwed object which includes the user information, ID and object name of the recently viewed record. The following apex code contains the logic to get the recently accessed records. The logic is straightforward we will pass the following user input values name of the object, fields to get and the number of the records to be returned. The annotation @AuraEnabled allows the lighting javascript controller to call the method
The above apex class will be called from the lightning javascript controller doInit function. Below is the lightning controller code
The syntax to call the apex controller from lightning javascript is component.get(“c.MethodName”) you can able to pass parameters to the method using action.setParams({parameters}); here we will be sending the ObjectName, Field names and limit as parameters. The setCallback function where we will form the table dynamically for the returned values from the apex controller.
Final & the important part of the component is UI which should give the native look and feel, so I chose Lightning Design system which brings the new salesforce lightning UI design for the custom component. The lightning component is easy to use similar to the other UI design system. To know more about the lighting design system check this link - https://www.lightningdesignsystem.com/
The complete source code of this component is in the following Github repo - https://github.com/Karanraj/RecentItems-Lightning
References
- Lightning Component Trailhead Module - https://developer.salesforce.com/trailhead/module/lightning_components
- Lightning Design system Module -- https://developer.salesforce.com/trailhead/module/lightning_design_system
ReplyDeleteGreat Blog!!! Was an interesting blog with a clear concept. And will surely help many to update them.
Salesforce Training in Chennai
Salesforce Training
ccna Training in Chennai
PHP Training in Chennai
ReactJS Training in Chennai
ui ux design course in chennai
Angularjs Training in Chennai
web designing training in chennai
Tally Course in Chennai
Hi
ReplyDeleteThanks for sharing your valuable information. Had a wonderful blog....
ReplyDeleteAngular JS Training in Chennai | Certification | Online Training Course | Angular JS Training in Bangalore | Certification | Online Training Course | Angular JS Training in Hyderabad | Certification | Online Training Course | Angular JS Training in Coimbatore | Certification | Online Training Course | Angular JS Training in Online | Certification | Online Training Course
I am so happy to found your blog post because it's really very informative. Please keep writing this kind of blogs and I regularly visit this blog. Have a look at my services.
ReplyDeleteCyber Security Training Course in Chennai | Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course | CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
Thank you for sharing valuable information. Thanks for providing a great informatic blog, really nice required information & the things I never imagined.
ReplyDeleteCyber Security Training Course in Chennai | Certification | Cyber Security Online Training Course | Ethical Hacking Training Course in Chennai | Certification | Ethical Hacking Online Training Course | CCNA Training Course in Chennai | Certification | CCNA Online Training Course | RPA Robotic Process Automation Training Course in Chennai | Certification | RPA Training Course Chennai | SEO Training in Chennai | Certification | SEO Online Training Course
Nice information, this is will helpfull a lot, Thank for sharing, Keep do posting i like to follow this ui online training
ReplyDeleteui design course
ui training
online ui training