Set focus on a property in a relationship grid


I have method attached to OnEditFinish of the property sort_order of the Part BOM relationship. The goal is to check if the property is filled and if no, to throw an error. After the display of the error, I want to set back the focus to the property so that the user can enter a value there. Is it possible to achieve that?

My Aras version is 12SP18.

I tried using the gridApplet but I couldn't find a function that can be used to achieve my goal.

Thank you Slight smile

  • Hi Skoleva,

    that´s a good question! But there are not many samples regarding this one. To be honest, I don´t know a single one.

    In regular Forms settings the focus to certain fields is pretty easy. But relationship grids are a bit different.

    You are correct that you have to use gridApplet. There are some focus related functions, but I never tried them by myself and don´t know the variables that are required for the functions.

    gridApplet should support these two functions:

    - "editCell"  - moves focus to cell and switch it to the editable mode.
    - "requestFocus" -  sets input focus to the control.

    I don´t have any samples, but I would try something like this:

    var g = gridApplet;
    g.requestFocus(relationshipID, colIndex);




    g.editCell(relationshipID, colIndex)

    Best regards