Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Chapter 15 Task Traceability

  • Task 1 → LoanRepaymentSchedule.Table.al (all Loan Repayment Schedule fields classified as CustomerContent per chapter guidance).
  • Task 2 → LoanRepaymentView.PermissionSet.al and LoanRepaymentFull.PermissionSet.al (split “View” and “Full” model).
  • Task 3 → Role assignment rationale:
    • View: assigned to finance auditors because they must inspect repayment status without changing records.
    • Full: assigned to loan operations users because they create schedules and mark installments paid.
  • Task 4 → "Borrower Name" should be EndUserIdentifiableInformation; keep it off broad-access pages and expose only via role-restricted page extension.

Code

LoanRepaymentSchedule.Table.al

table 50100 "Loan Repayment Schedule"
{
    DataClassification = CustomerContent;

    fields
    {
        field(1; "Loan No."; Code[20])
        {
            DataClassification = CustomerContent;
        }
        field(2; "Installment No."; Integer)
        {
            DataClassification = CustomerContent;
        }
        field(3; "Vendor No."; Code[20])
        {
            DataClassification = CustomerContent;
            TableRelation = Vendor."No.";
        }
        field(4; "Due Date"; Date)
        {
            DataClassification = CustomerContent;
        }
        field(5; "Payment Date"; Date)
        {
            DataClassification = CustomerContent;
        }
        field(6; "Principal Amount"; Decimal)
        {
            DataClassification = CustomerContent;
        }
        field(7; "Interest Amount"; Decimal)
        {
            DataClassification = CustomerContent;
        }
        field(8; "Total Amount"; Decimal)
        {
            DataClassification = CustomerContent;
        }
        field(9; Paid; Boolean)
        {
            DataClassification = CustomerContent;
        }
    }

    keys
    {
        key(PK; "Loan No.", "Installment No.")
        {
            Clustered = true;
        }
    }

    trigger OnInsert()
    begin
        "Total Amount" := "Principal Amount" + "Interest Amount";
    end;

    trigger OnModify()
    begin
        if xRec.Paid then
            Error('A paid installment cannot be changed.');
        "Total Amount" := "Principal Amount" + "Interest Amount";
    end;
}

LoanRepaymentView.PermissionSet.al

permissionset 50103 "Loan Repayment - View"
{
    Assignable = true;
    Caption = 'Loan Repayment (View Only)';

    Permissions =
        table "Loan Repayment Schedule" = X,
        tabledata "Loan Repayment Schedule" = R,
        page "Loan Repayment Schedule List" = X;
}

LoanRepaymentFull.PermissionSet.al

permissionset 50104 "Loan Repayment - Full"
{
    Assignable = true;
    Caption = 'Loan Repayment (Full Access)';
    IncludedPermissionSets = "Loan Repayment - View";

    Permissions =
        tabledata "Loan Repayment Schedule" = IMD,
        codeunit "Loan Repayment Mgt." = X;
}