Field in related record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tothewine
    Active Community Member
    • Jan 2018
    • 373

    Field in related record

    Is it possible, in the case of creating a related record in the lower panels, to ensure that some fields of the record are already pre-populated? What should be set in the formula?
  • zerosix
    Member
    • Jan 2024
    • 45

    #2
    get the ids of the related records and check them or update them with record\update()

    Comment

    • rabii
      Active Community Member
      • Jun 2016
      • 1250

      #3
      Originally posted by tothewine
      Is it possible, in the case of creating a related record in the lower panels, to ensure that some fields of the record are already pre-populated? What should be set in the formula?
      Formula won't pre-populate the fields, it will set them when the record is saved. However if you mean to pre-populate the fields of the related record with some values from the parent entity then yes, you can do it in the clientDefs / relationship of the parent entity. Below is the code example between the account and contact when a new contact is created it will pre-populate the address from the account address

      PHP Code:
      "contacts": {
                  "createAttributeMap": {
                      "billingAddressCity": "addressCity",
                      "billingAddressStreet": "addressStreet",
                      "billingAddressPostalCode": "addressPostalCode",
                      "billingAddressState": "addressState",
                      "billingAddressCountry": "addressCountry",
                      "id": "accountId",
                      "name": "accountName"
                  }
      } 
      
      Rabii
      Web Dev

      Comment

      Working...