Forum Discussion

team_aras_meupe_com's avatar
3 years ago
Solved

Calling "Run Search" button by code

Hi, is it possible to call the "Run search" button in a method?

I have an action that updates the quantities and price of various records, but it does not update it on the screen.
It only updates the data on the screen if the line to be modified has been chosen, but this action, just by choosing a line, already updates all the orders that hang from it, so it is not necessary to select all the lines.

I have tried trying to update each time I edit the Itemtype with "aras.uiReShowItem(desgl.getID(), desgl.getID());", but it does not update the data on the screen.

But when the process ends ARAS automatically updates the data on the screen of the selected lines, or if I press the "run search" button it also updates.

For example, if I launch the action here, the prices of the 4 lines would be updated in the database, but by only having 2 selected, on the screen, it would only show me the change of the 2 selected.

Too many thanks!!!

  • Hello, 

    You can try this piece of code if your method is JavaScript. [emoticon:c4563cd7d5574777a71c318021cbbcc8]


    [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:5f16a887-45f8-4386-a0c3-386aeecb4253:type=javascript&text=const%20topWindow%20%3D%20aras.getMostTopWindowWithAras%28window%29%3B%20%0D%0Aif%20%28topWindow.work%20%26%26%20topWindow.work.grid%29%20%0D%0A%7B%0D%0A%20%20%20%20main.work.searchContainer.runSearch%28%29%3B%0D%0A%7D%0D%0Aelse%0D%0A%7B%0D%0A%20%20%20%20parent.onRefresh%28%29%3B%0D%0A%7D]

    Regards

    P.S. Thank you, angela for sharing this [emoticon:c4563cd7d5574777a71c318021cbbcc8]

3 Replies

  • Hello, 

    You can try this piece of code if your method is JavaScript. [emoticon:c4563cd7d5574777a71c318021cbbcc8]


    [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:5f16a887-45f8-4386-a0c3-386aeecb4253:type=javascript&text=const%20topWindow%20%3D%20aras.getMostTopWindowWithAras%28window%29%3B%20%0D%0Aif%20%28topWindow.work%20%26%26%20topWindow.work.grid%29%20%0D%0A%7B%0D%0A%20%20%20%20main.work.searchContainer.runSearch%28%29%3B%0D%0A%7D%0D%0Aelse%0D%0A%7B%0D%0A%20%20%20%20parent.onRefresh%28%29%3B%0D%0A%7D]

    Regards

    P.S. Thank you, angela for sharing this [emoticon:c4563cd7d5574777a71c318021cbbcc8]

    • team_aras_meupe_com's avatar
      team_aras_meupe_com
      Creator III

      Hello, thank you very much, it works perfectly!!!.

      Too many thanks to you and Angelap too. hehe.

      Sorry, i used the search option in the forum but i didn't see your post

      Thanks!!!

  • I have an action that updates the quantities and price of various records, but it does not update it on the screen.
    It only updates the data on the screen if the line to be modified has been chosen, but this action, just by choosing a line, already updates all the orders that hang from it, so it is not necessary to select all the lines.