Skip to content

CharlesHGong/lightningRelatedListWithFilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI Status: CircleCI

Please 'Star' this repo if you like it!

Huge Kudos to @RekHidalgo for being an initial colaborator and maintained this component for many release 🎉

If you like this component, you could buy us a coffee:

Buy Me A Coffee or Alt text

Lightning Related List With Filter

This repository is a lightning component which mimimic the look and feel with the out of box related list but give you more control on:

  1. You can apply filter of your choice on the related list.
  2. You are not limited to child object but any grand-child object as long as it can reference back to the parent.
  3. You can specify the title of the related list that is meaningful to you.
  4. You are not limited to only four fields to show.
  5. You are not limited to 6 records but have more control on how many records you want to show,
  6. You don't have to show the ugly bar code for you child object.
  7. You can choose from display types of List or Tile.

Currently the related list supports the following field type:

  1. Text
  2. Number
  3. Percent
  4. Date
  5. Datetime
  6. Checkbox
  7. Picklist
  8. Muti-picklist
  9. Lookup
  10. Master-Detail
  11. Email
  12. Phone
  13. URL

Getting Started

If you are using sfdx

  1. Clone this repo
git clone https://github.com/libra34567/lightningRelatedListWithFilter.git
  1. Direct to the root
cd lightningRelatedListWithFilter/
  1. Deploy to your desired org
sfdx force:source:deploy -p sf_relatedList -u $YOURORGNAME

If you are using meta-data

  1. Clone this repo
git clone https://github.com/libra34567/lightningRelatedListWithFilter.git
  1. Direct to the root/package
cd lightningRelatedListWithFilter/package
  1. Ant deploy the package
 

How to use the related list on your lightning record page

  1. Navigate to the parent object record page and click edit page
  2. Drag the RelatedListComponent to the desired space
  3. Type in the relevant attributes
  4. The related list will show Alt text Alt text

Key Attributes

1. Object

This field is used in the SOQL after FROM Clause. This is the API name of your related object, be careful with the letter case, it matters when you try to create a related record. It supports custom objects as well.

Example 1: Contact

Alt text

Example 2: Bank_Account__c

Alt text

2. Title

This the title of your realted list. Alt text

3. Fields

This field is used in the SOQL after SELECT Clause. Specify all the fields API name that you want to display for the related object. Seperate each field with a semi-column.

Example 1: Contact

Alt text

4. Sort Order

This field is used in the SOQL after ORDER BY Clause. If you want to sord your related list, specify the 'Order By' field and the sort order (desc or asc). Otherwise leave blank.

Example 1: birthdate asc

Alt text

Example 2: birthdate desc

Alt text

5. Conditions

This field is used in the SOQL after WHERE Clause. You can use this field to filter your related list. Use the variable "recordId" to specify the relationship column (e.g. AccountId =: recordId) or otherwise the component will choose from all record.

Example 1:

Alt text

6. Relationship

This field is used to prepopulate the relationship field if the user clicks "New" button. Alt text

7. Limit

This field is used in the SOQL after LIMIT Clause. This will limit the maximum records showing in the related list. The remaining records can be seen by clicking "View More"

Example 1:

Alt text

8. ActionList

Choose from create,view and edit to show in the action list of the related record. User semi-column to seperate each action.

a. Create

Alt text

b. Edit
c. View

Alt text

9. IconName

If you want to override the icon, choose the icon from https://www.lightningdesignsystem.com/icons/ (e.g. standard:Contact). Otherwise leave it blank, the component will choose the default icon from the Tab setting for this related object.

Example 1:

Alt text

10. DisplayFormat

Choose from Tile or List.

Example 1: List

Alt text

Example 2: Tile

Alt text

Reporting Issues

If you find any issues with this demo that you can't fix, feel free to report them in the issues section of this repository.

If you have any suggestions for improvement or question of how to use this component, feel free to reach out to the collaborators at [email protected] | [email protected]

About

Lightning related list with filter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published