Library Management with Frappe Framework
Library Membership
Faris Ansari
May 19, 2021

Let's create another doctype: Library Membership. It will have the following fields:

  1. Library Member (Link, Mandatory)
  2. Full Name (Data, Read Only)
  3. From Date (Date)
  4. To Date (Date)
  5. Paid (Check)

It will have Is Submittable enabled. It will have Naming set as LMS.##### and restricted to Librarian role. Also, the Title Field should be set to full_name in the View Settings section.

Library Membership DocType

The Link field Library Member is similar to a Foreign Key column in other frameworks. It will let you link the value to a record in another DocType. In this case, it links to a record of Library Member DocType.

The Full Name field is a Read Only field that will be automatically fetched from from the full_name field in the linked record Library Member.

Now, go to the Library Membership list and create a new document. You will see that the Library Member field is a dropdown with existing records shown as options. Select a Library Member and the Full Name will be fetched automatically. Pretty cool, right?

Have a doubt?
Post it here, our mentors will help you out.