Announcement

Collapse
No announcement yet.

Filter a Link field by foreign variable

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

  • #16
    don't use uppercase in views
    Does Testbase entity have account link field?

    Comment


    • #17
      Hello Tanya,

      thank you for your help.

      All uppercase are change now.
      i change in :
      \custom\Espo\Custom\Resources\metadata\entityDefs\ Opportunity.json
      {
      "fields": {
      "testbases": {
      "type": "linkMultiple",
      "view": "custom:views/opportunity/fields/testbase", XXX change here
      "layoutDetailDisabled": false,
      "layoutMassUpdateDisabled": false,
      "importDisabled": false,
      "noLoad": false,
      "isCustom": true
      }
      },
      "links": {
      "testbases": {
      "type": "hasMany",
      "relationName": "testbaseOpportunity",
      "foreign": "opportunities",
      "entity": "testbase", XXX change here
      "audited": false,
      "isCustom": true
      }
      }
      }


      and

      Espo.define('custom:views/opportunity/fields/testbase', 'views/fields/link-multiple-with-role', function (Dep) { XXX change here

      return Dep.extend({

      getSelectFilters: function () {
      if (this.model.get('accountId')) {
      return {
      'account': {
      type: 'equals',
      field: 'accountId',
      value: this.model.get('accountId'),
      valueName: this.model.get('accountName'),
      }
      };
      }
      },

      getCreateAttributes: function () {
      if (this.model.get('accountId')) {
      return {
      accountId: this.model.get('accountId'),
      accountName: this.model.get('accountName')
      }
      }
      }

      });

      });


      and i change the name of file : from Testbase.js to testbase.js

      The testbase entity has a account multi-link field.

      I have the same problem with change uppercase in views.

      have you a idea ?

      thank you.
      Etienne

      Comment


      • #18
        in getSelectFilters you use parameters as for link field used
        EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.


        but you need as for link-multiple

        Comment


        • #19
          thank you.
          I try this today.

          Etienne

          Comment

          Working...
          X