How do I refresh a form when data has been added externally? - Axapta

This is a discussion on How do I refresh a form when data has been added externally? - Axapta ; I have a third pary app and I am using the .NET Business Connector to add data into AX from this app. This app is launched from within AX (a button on the purchase order - lines grid) and adds ...

+ Reply to Thread
Results 1 to 5 of 5

How do I refresh a form when data has been added externally?

  1. Default How do I refresh a form when data has been added externally?

    I have a third pary app and I am using the .NET Business Connector to add
    data into AX from this app. This app is launched from within AX (a button on
    the purchase order - lines grid) and adds lines to the current purchase
    order.
    When the user comes back into AX after adding the data into AX, I want the
    grid to automatically refresh. The data is there and I can manually refresh
    the form to see it but isn't there some event that would trigger a form
    refresh such as the gotFocus() event ? I have tried everything I can think of
    but the form events don't get triggered the way I expect them to.
    Thanks

  2. Default RE: How do I refresh a form when data has been added externally?

    Well, I guess the closest thing you will get is implementing a refresh based
    on a timer.
    You can see how it is already implemented on the Inventory Journals header
    forms.
    (Forms\InventJournalTable)
    --
    Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
    My blog - http://kashperuk.blogspot.com
    Download MorphX IT in Russian - http://www.lulu.com/content/723888


    "gpja" wrote:

    > I have a third pary app and I am using the .NET Business Connector to add
    > data into AX from this app. This app is launched from within AX (a button on
    > the purchase order - lines grid) and adds lines to the current purchase
    > order.
    > When the user comes back into AX after adding the data into AX, I want the
    > grid to automatically refresh. The data is there and I can manually refresh
    > the form to see it but isn't there some event that would trigger a form
    > refresh such as the gotFocus() event ? I have tried everything I can think of
    > but the form events don't get triggered the way I expect them to.
    > Thanks


  3. Default RE: How do I refresh a form when data has been added externally?


    Using a timer wouldn't work - I need the data to refresh once the user
    returns to AX from the third party app.

    Is there no event that could be used to refresh the form?

  4. Default RE: How do I refresh a form when data has been added externally?

    when the user get out from ax and use your external app, the form lost the
    focus, but when the user go back to the AX, they need to re-select the form,
    maybe you can get this event and refresh the datasource.

    activate by morphx_it:
    "Called each time a form is in focus. If switching between two forms the
    method will be called when selecting the form as the active form. See form
    PBATable."


    []s
    Ricardo Pichler



    "gpja" wrote:

    >
    > Using a timer wouldn't work - I need the data to refresh once the user
    > returns to AX from the third party app.
    >
    > Is there no event that could be used to refresh the form?


  5. Default RE: How do I refresh a form when data has been added externally?

    The problem with the active method is that several of the fields on the grid
    are lookup fields and thus are rendered unusable if I refresh the datasource
    on the active method.
    I added a boolean "NeedToRefresh" that is only set to true on the button
    click event that launches the third pary app. On the mouseEnter method of the
    form (returning from the third party app) I have:

    if(NeedToRefresh)
    {
    NeedToRefresh = false;
    datasource.executeQuery();
    }

    I have done some simple testing and it seems to work okay.


    "Ricardo Pichler" wrote:

    > when the user get out from ax and use your external app, the form lost the
    > focus, but when the user go back to the AX, they need to re-select the form,
    > maybe you can get this event and refresh the datasource.
    >
    > activate by morphx_it:
    > "Called each time a form is in focus. If switching between two forms the
    > method will be called when selecting the form as the active form. See form
    > PBATable."
    >
    >
    > []s
    > Ricardo Pichler
    >
    >
    >
    > "gpja" wrote:
    >
    > >
    > > Using a timer wouldn't work - I need the data to refresh once the user
    > > returns to AX from the third party app.
    > >
    > > Is there no event that could be used to refresh the form?


+ Reply to Thread