display foreign name from link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gpatri
    Junior Member
    • May 2017
    • 19

    display foreign name from link

    I created a link between Account and a new entities. But in my details form I see AccountId, a try a formula to have account.name, but 'none'.

    How to display account.name inside the remote entity?
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello

    If you created one-to-many (or many-to-one, depends on direction) relationship and add "account" field to the detail layout of you new entity in Layout Manager, It has to work without formula.
    Foreign fields works as well without formula

    Enjoy the videos and music that you love, upload original content and share it all with friends, family and the world on YouTube.

    Comment

    • gpatri
      Junior Member
      • May 2017
      • 19

      #3
      The link are 'hasOne' 'belongTo', and the ID are display.

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        You have a working example. You don't need to define accountName
        Attach your entityDefs

        Comment

        • gpatri
          Junior Member
          • May 2017
          • 19

          #5
          From Bcc.json :
          Code:
          {
          [B]"fields"[/B]: {
          [B]  "account"[/B]: {
          [B]    "type"[/B]: [B]"link"[/B],
          [B]    "view"[/B]: [B]"views/fields/link"[/B]
            },
           },
          
          [B]"links"[/B]: {
          [B]  "account"[/B]: {
          [B]  "type"[/B]: [B]"belongTo"[/B],
          [B]  "entity"[/B]: [B]"Account"[/B]
          },
          
          }
          From Account.json:

          Code:
          {
          
          "links": {
              "bcc": {
                  "type": "hasOne",
                  "foreign": "account",
                  "entity": "Bcc",
                  "audited": false,
                  "isCustom": true
              }
          }}
          Last edited by gpatri; 05-26-2017, 05:58 PM.

          Comment

          • gpatri
            Junior Member
            • May 2017
            • 19

            #6
            Working! thanks

            I have to remove:
            "view": "views/fields/link"

            Comment

            Working...