In this article, let us see in detail about the Related Lists. This, we might have used for a long time without knowing the exact usage practice. Today let me try to explain in detail about the related list.
To explain that, I created two lists.
b. ConsumerList – Which will be having a lookup field referring from the Source List.
A simple Source List will be as below.
And the Consumer List is as below.
In the Edit and Display Form of the Source item, I want to display the Consumer List Items filtered with the Source Item. Basically, we can relate this as a Transaction Master table and the Transaction Details table. Basically, when we edit or view the Transaction master, we may need to see the transaction details as well right. To achieve this on the OOB EditForm and DisplayForm pages, we can add the Related WebParts.
1. Go to the Source List and select the “Form Webparts” section on the ribbon.
2. Select the “Default Edit Form”. (We are focusing only the Edit Form as it does not make any sense to add the Details on the Newform. It’s a logical thing right. When we are creating a new master, at that time, the details will not be there. Even, if we add the details, it will not show anything on the new form always. That’s the reason, we are focusing only the edit and display form. In this sample, we will focus on the Edit Form. The same thing can be repeated on the Display Form.
3. Edit the Page.
4. On the top ribbon, the Related Lists will show all the lists, which are consuming Lookup column from the Source List.
5. Add the Consumer List on the screen.
6. Once, we add the webpart, go to the properties of the webpart. It will be as below.
7. When we go to the Edit Of any item, the consumer list webpart will display the corresponding child items.
Basically the Source WebPart will provide rows to the Consumer WebPart and the Consumer Webpart will be filtered with the Source WebPart Item.