Foreign field with another foreign field's value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jj.payally
    Junior Member
    • Jun 2023
    • 15

    Foreign field with another foreign field's value

    Hi,
    We have entity 'Accounts' and it has foreign field 'Assigned User' from entity 'Users' (client and assigned manager).
    Also we have entity 'Debit Cards', which has foreign field 'Assigned User' too, but additionally it has foreign field 'Account' (debit card, manager who responsible for card, client - card's owner).
    How can i display in 'Debit card' information from 'Accounts'->'Assigned User' entity?
  • victor
    Active Community Member
    • Aug 2022
    • 731

    #2
    You can do as follows:
    - In Administration > Entity Manager > Debit Card > Fields create a field assignedUserFromAccount with type Varchar.
    - In Administration > Entity Manager > Debit Card > Formula > Before Save Custom Script add a simple formula:​
    Code:
    assignedUserFromAccount = account.assignedUserName;
    Thus, the field assignedUserFromAccount will display the name of Assigned User from the account with which this Debit Card is related.

    Comment


    • jj.payally
      jj.payally commented
      Editing a comment
      Ok, i created new field and formula. Now to get values into that field, i need to update all Debit Card records. Is it possible to do it in simple way?
  • victor
    Active Community Member
    • Aug 2022
    • 731

    #3
    Ok, i created new field and formula. Now to get values into that field, i need to update all Debit Card records. Is it possible to do it in simple way?
    1)
    Click image for larger version

Name:	image.png
Views:	125
Size:	11.9 KB
ID:	101595
    2)
    Click image for larger version

Name:	image.png
Views:	113
Size:	9.7 KB
ID:	101596​​​

    Comment


    • jj.payally
      jj.payally commented
      Editing a comment
      Yes, I found that method. It is ok when you have <1000 records, but if there is >10000 ? In my situation i had 1700, so it took some time to load all of them on one screen, mark and recalculate. But i have another similar task from CRM managers to create additional calculated field for entity with 100000 records...
      Last edited by jj.payally; 01-16-2024, 06:18 PM.
  • victor
    Active Community Member
    • Aug 2022
    • 731

    #4
    jj.payally,

    Look closely at the second screenshot. On this screenshot, you need to click on the small triangle to select absolutely all records of your entity by 1 click.

    Comment


    • jj.payally
      jj.payally commented
      Editing a comment
      Beg my pardon, you mean 'Select All Result' selects complete all records (with not displayed on page) ?

    • victor
      victor commented
      Editing a comment
      That's right: absolutely all records (both those displayed on the page and those not).
Working...