How can I reload My Inbasket grid before I close a custom dialog

オフライン

Hi,

I've created a custom dialog to complete workflow tasks. I would like to know if is possible to reload My Inbasket grid after this dialog closed.

My Aras Innovator version is 11 SP5

Regards,

Jonatas

Parents
  • Hi Jonatas,

    I assume that you open this dialog from the "My InBasket" grid, since if you needed to navigate there after the custom dialog closes, you wouldn't need to refresh it. What worked for me in a smiliar situation is to rerun the search on the grid after your custom dialog closes:

    // My dialog parameters
    var param = {
       aras: aras,
       type: 'SearchDialog',
       dialogWidth: 700,
       dialogHeight: 450,
       itemtypeName: 'Part',
    };

    // The function that runs the search after the dialog is closed.
    function callback(res) {
       if (res) {
         var topWindow = aras.getMostTopWindowWithAras(window);
         var workerFrame = topWindow.work;
         if (workerFrame && workerFrame.searchContainer) {
           workerFrame.searchContainer.runSearch();
         }
       }
    }

    var topWnd = aras.getMostTopWindowWithAras();
    var wnd = topWnd ? topWnd : window;

    var openDialog = wnd.ArasModules.MaximazableDialog.show('iframe', param);

    openDialog.promise.then(callback);

    This will run the search on the current grid after your custom dialog closes.
    Does this help?

    Cheers,

    C

  • 0 オフライン in reply to cogres

    Hi cogres, thanks for the answer.

    The dialog opens from other item form, not from my in basket menu/grid.

    This dialog has worfklow vote options, and when an user select one of these options, a method is executed completing a workflow task. The problem is, when that task is completed, my inbasket grid view is not updated, the task still remains viisible in the grid, the user must to run a search on my inbasket view to update, and then the task disapear, because is completed. I want to know if is possible to execute a search to update my inbasket grid automatically after the dialog is closed or a method is executed.

    Regards,

    Jonatas

  • Hi Jonatas,

    okay, I see. I would still say that something like



    var topWindow = aras.getMostTopWindowWithAras(window);
    var workerFrame = topWindow.work;
    if (workerFrame && workerFrame.searchContainer) {
      workerFrame.searchContainer.runSearch();
    }

    is what you are looking for. You just need to identify the correct object in your setup that holds the right searchContainer and then run runSearch() on it.

    Without knowing more about the exact nature of the setup, I can't say much more. How do you access the "My InBasket" grid from the "other item form"? On a relationship tab?
    It is definitely possible to run a search for a grid on a relationships tab in a client side method, with similar to the above code.

    Cheers,


    C

  • 0 オフライン in reply to cogres

    I've recorded an example of the scenario, hope that help to demonstrate the problem:

    https://www.youtube.com/watch?v=c0UGkl7DSYs&feature=youtu.be

    Regards,

    Jonatas

  • Hi Jonatas,

    Thanks for the clarifying video! I think what you could do is the following:

    You could set an onUnload JavaScript method on the form that you open in the video under "Form Events":

    In that JavaScript method you need to include the following line of code:

    aras.getMainWindow().work.searchContainer.runSearch();

    This should make it so that when you close the form shown in the video, it should run the search for "My InBasket" automatically.

    Note that if your client side method contains only that line of code, it will run a search on the main window whenever you close that form, even if that does not include the "My InBasket" grid. You'd have to implement some checks in the code beforehand for that.

    Hope this helps,

    C

  • 0 オフライン in reply to cogres

    Hi cogres, thanks for the answer!

    I've applied the code, but when the form is unloaded this error occur:

    Event handler failed with message: TypeError: aras.getMainWindow(...).work is undefined [function onbeforeunload$user$handler(e) { try { if (onbeforeunload1(e) === false) return false; } catch (exp) { aras.AlertError(aras.getResource('', 'ui_methods_ex.event_handler_failed'), aras.getResource('', 'ui_methods_ex.event_handler_failure_msg', exp.description ? exp.description : (exp + ' [' +arguments.callee.toString()+ ']')), aras.getResource('','common.client_side_err')); return false; } }]

    Thanks in advance for the help!

    Regards, 

    Jonatas

  • Hi Jonatas,

    I will do some more investigating (maybe someone else knows more in the meantime). All I can think of right now - before installing an 11 SP5 instance myself - is that maybe you need to use

    top.aras.getMainWindow().work.searchContainer.runSearch();

    instead.


    Please let me know if you find out anything yourself as well :).

    Cheers,

    C

  • 0 オフライン in reply to cogres

    Hi cogres,


    Thanks for the suggestion, but did not worked to.

    If I find some solution for this case, I will post it here.

    Thanks.

Reply Children
No Data