auto set fields based on the contents of other fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • llen
    Junior Member
    • Dec 2023
    • 11

    auto set fields based on the contents of other fields

    hello, good afternoon.

    I want to ask. I have two entities, namely ads and outlets and both are related. in ads there is an account fields and when I want to create an outlet, I must also select an account. I want to know how to make this account automatically filled/change directly when the user creates an outlet in ads base on value in account ads.
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    Ok i will reply here for your question. here is what you need to do.

    edit > custom/Espo/Custom/Resources/metadata/clientDefs/Ads.json (i assume this is the correct name of the entity Ads as you mentioned above) - search for relationshipPanels and add this section below to the outlets which i assume is the name of the relationship between ads and outlet entities. add the code below at the end of the outlets relationship. make sure that you give the correct name (i assumed that account is the correct name of the field link in both entities)

    PHP Code:
    "createAttributeMap": {
          "accountId": "accountId",
          "accountName": "accountName"
     }

    This will allow to pass the account from ads to outlet when a related record is created.
    Hope this helps
    Rabii
    Web Dev

    Comment

    Working...