Accessing form fields values in Lookup_Selecting

When we use Lookup Table, we cannot have the information of the existing Fields in Lookup_Selecting to filter the information based on them…

For example, we want to have a “Lookup Table” in the “Detail” section, so that every time we enter information from it, that value will not be displayed in the Lookup of other rows…
Or other cases…

// file :"ew.js" 

    _proto.generateRequest = function generateRequest() {
      var _data$ajax;
      var data = Object.assign({}, this.data, {
        name: this.element.name,
        page: this.list.page,
        field: this.list.field,
        language: ew.LANGUAGE_ID
      }, ew.getUserParams("#p_" + this.elementId, this.formElement));
      (_data$ajax = data.ajax) != null ? _data$ajax : data.ajax = this.action;
      if (this.parentFields.length > 0) this.parentFields.forEach((pf, i) => data["v" + (i + 1)] = ew.getOptionValue(pf, this.formElement));
      return data;
    }

The above function sends the Field data to the “Lookup” . Adding the following code before “return data;” can send the entire value with “allelement” to if needed.

      // ...
      data['allelement'] = encodeURIComponent($(this.element.form).serialize())
      return data;
    }

Can you suggest another way to do this?

Only the values of the related fields (i.e. the parent fields) can be sent. If you want to send other values, you can only use jQuery’s ajaxSend event to intercept it.

1 Like

Very good advice :100: