Announcement

Collapse
No announcement yet.

Access data from view of custom field

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

  • Access data from view of custom field

    Good day.

    There are two entities:

    Entity1
    - Field1
    - Relation One-to-many Entity2

    Entity2
    - Field2
    - CustomField
    - Relation Many-to-one Entity1

    Please tell me - how can I access the data of Field1 and Field2 from the view of a custom field? (Custom: views/fields/CustomField.js)
    If possible, a small example, please.
    Last edited by kertys; 11-19-2019, 07:55 AM.

  • #2
    Hi,

    I recommend to create a a foreign in Entity2 for Field1.

    Then you will be able to access it with this.model.get('foreignFieldName');


    Comment


    • #3
      Thanks, everything works great!

      Comment


      • #4

        And one more question about views/fields/CustomField.js

        I need to set the value of CustomField from a third-party custom bash script, the result of which is displayed in stdout.
        I try this design:
        ===
        const execFile = require ('child_process').execFile;
        var data = execFile('myscript.sh', ['arg1', 'arg2'], (error, stdout, stderr) => {
        if (error) {
        throw error;
        }
        console.log (stdout); });
        ===
        but it does not work
        Please tell me how to do this?

        Comment

        Working...
        X