Announcement

Collapse
No announcement yet.

show field from foreign entity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • show field from foreign entity

    We are using EspoCRM 4.0.3, created custom fields on Account and now want to display these custom fields on linked entities like IncomingInvoice.

    Relationship "Many-to-One" from incomingInvoices to Accounts (Account has incomingInvoices)

    I found an older disscussion using
    Code:
    "type": "foreign"
    http://forum.espocrm.com/forum/devel...y-s-properties

    So I defined a new field in incomingInvoices:
    After a rebuild I get a HTTP 500 on the incomingInvoices list view even if I don't add fields to the list view:
    Code:
            "accountInfo" : {
                "type" : "foreign",
                "link" : "account",
                "foreign" : "description"
            }
    after rebuild I get an empty json from /api/v1/IncomingInvoice

    in data/cache/application/ormMetadata.php the required relation is there
    Code:
          'accountInfo' =>
          array (
            'type' => 'foreign',
            'relation' => 'account'
    Questions:

    How can I add a foreign field to a view?
    How can I enforce error logging since in the espo log no entries are shown when calling the url?

    Thanks a lot in advance vor any hint.

  • #2
    Anyone who can give me a hint how to use field
    "type": "foreign" or if it's broken? Thanks a lot hi-ko

    Comment


    • #3
      OK. Got it working (I switched "notCreatable" : false in application/Espo/Resources/metadata/fields/foreign.json to allow creation from UI):
      in Resources/metadata/entityDefs/ I had to add "skip": false
      Code:
              "accountTest": {
                  "skip": false,
                  "type": "foreign",
                  "link": "account",
                  "field": "description",
                  "isCustom": true
              }

      Comment

      Working...
      X