Relationship scenario

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashif Malayil
    Senior Member
    • Dec 2023
    • 201

    Relationship scenario

    I have three entities: Data Name, Programme, and Existing Loan.
    • Programme has a many-to-one relationship with Data Name.
    • Data Name has a one-to-many relationship with Existing Loan.

    Objective

    I need to write a formula in Programme to fetch a specific value (e.g., outstandingAmount) from Existing Loan.

    For example:

    formula:
    account.existingLoan.outstandingAmount

    However, I want to ensure that only the Existing Loan records associated with the corresponding Data Name are considered.

    Question
    1. Can I achieve this using the existing relationships, or do I need to create a direct one-to-many relationship between Programme and Existing Loan?
    2. If a direct relationship is necessary, how can I filter only the Existing Loan records related to the same Data Name as the Programme?
  • lazovic
    Super Moderator
    • Jan 2022
    • 932

    #2
    Hi Ashif Malayil,

    Please tell me do I understand correctly that several Existing Loan entities can be linked to a Data Name entity? If so, then there is a possibility that there are several outstandingAmount values, and it turns out that we don't understand which one we need. Also, it is not entirely clear what the account has to do with the formula script. We would be grateful if you could explain everything in a little more detail.

    Comment

    • Ashif Malayil
      Senior Member
      • Dec 2023
      • 201

      #3
      lazovic,Yes, you understood correctly. Multiple Existing Loan records can be linked to a single Data Name, and each Existing Loan has an outstandingAmount value.

      My goal is to fetch a specific outstandingAmount from Existing Loan inside the Programme entity. The challenge is that Programme is linked to Data Name (many-to-one), and Data Name is linked to Existing Loan (one-to-many). Since there is no direct relationship between Programme and Existing Loan, I need to ensure that only the Existing Loan records associated with the same Data Name are considered in the Programme entity.

      Regarding the formula, I mentioned account.existingLoan.outstandingAmount as an example, but I realize it might not be the right approach. The key questions are:
      1. Can I fetch the outstandingAmount using the existing relationships, or do I need a direct one-to-many link between Programme and Existing Loan?
      2. If a direct link is needed, how do I filter only those Existing Loan records that belong to the same Data Name within the Programme entity?
      Note: Account entity is renamed to Date Name

      Let me know if this explanation is clear!

      Comment

      • Ashif Malayil
        Senior Member
        • Dec 2023
        • 201

        #4
        Hi lazovic,


        There are a few changes to the scenario. The modules are Data Name and Existing Loans, with a one-to-many relationship from Data Name to Existing Loans. In the bottom panel, there are multiple Existing Loans, each with an Outstanding Value field. A formula currently calculates the total outstanding value in the Data Name entity’s Outstanding Value field.

        Additionally, the Data Name entity is linked to a Programme entity. The goal is to create a formula that:
        1. Checks if the Programme name contains "ABCD".
        2. Only sums the Outstanding Value from Existing Loans where a field which contains "ABCD" exists (and similarly for other programmes like "EFGH").

        How can this conditional logic be implemented, especially with multiple such conditions?

        Comment

        Working...