Code Monkey home page Code Monkey logo

lightningrelatedlistwithfilter's Introduction

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
 
 
Deploy to Salesforce

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]

lightningrelatedlistwithfilter's People

Contributors

charleshgong avatar rgonola avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.