Skip to content

EspoCRM – Open Source CRM Application

entity param

Yuri Kuznetsov8407d27ea0a4
diff --git a/client/src/views/fields/link-multiple.js b/client/src/views/fields/link-multiple.js
index 9a6ed3c178..c877e7ca4b 100644
--- a/client/src/views/fields/link-multiple.js
+++ b/client/src/views/fields/link-multiple.js
@@ -55,6 +55,7 @@ class LinkMultipleFieldView extends BaseFieldView {
* @property {boolean} [sortable] Sortable.
* @property {boolean} [createButton] Show 'Create' button.
* @property {number} [maxCount] A max number of items.
+ * @property {string} [entity] An entity type. As of 9.1.0.
*/
/**
@@ -355,8 +356,10 @@ class LinkMultipleFieldView extends BaseFieldView {
this.nameHashName = this.name + 'Names';
this.idsName = this.name + 'Ids';
- this.foreignScope = this.options.foreignScope ||
+ this.foreignScope =
+ this.options.foreignScope ||
this.foreignScope ||
+ this.params.entity ||
this.model.getFieldParam(this.name, 'entity') ||
this.model.getLinkParam(this.name, 'entity');
diff --git a/client/src/views/fields/link.js b/client/src/views/fields/link.js
index 0167273695..b955468931 100644
--- a/client/src/views/fields/link.js
+++ b/client/src/views/fields/link.js
@@ -53,6 +53,7 @@ class LinkFieldView extends BaseFieldView {
* @property {boolean} [required] Required.
* @property {boolean} [autocompleteOnEmpty] Autocomplete on empty input.
* @property {boolean} [createButton] Show 'Create' button.
+ * @property {string} [entity] An entity type. As of 9.1.0.
*/
/**
@@ -347,8 +348,11 @@ class LinkFieldView extends BaseFieldView {
this.foreignScope = this.options.foreignScope || this.foreignScope;
- this.foreignScope = this.foreignScope ||
- this.model.getFieldParam(this.name, 'entity') || this.model.getLinkParam(this.name, 'entity');
+ this.foreignScope =
+ this.foreignScope ||
+ this.params.entity ||
+ this.model.getFieldParam(this.name, 'entity') ||
+ this.model.getLinkParam(this.name, 'entity');
if ('createDisabled' in this.options) {
this.createDisabled = this.options.createDisabled;