• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Refresh Data in a second app

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

  • Refresh Data in a second app

    I have a Refresh button in an app. This app could have a second app open at the same time. I would like for my Refresh button to also refresh the second app.

    I created a public event in app #1... I'm having app #2 listen for that event. However, the only utilities available under the Utility option of the event listener are Close App and Print Application. Refresh is not an option.

    Is there a way to refresh all of the widgets in the second app?

  • #2
    I would create an app variable, link that variable to all the widgets to refresh, and then set it to true when you want to refresh all the widgets.

    Comment


    • #3
      My separate apps are Orders and Invoices. Widgets in Orders are linked to an app variable to refresh the Order widgets. Widgets in Invoices app are linked to an app variable "loadInvoiceWidgets" to refresh those widgets.

      I have a Refresh button in the Orders app. The Invoices app is shown as a section inside he Orders app.

      On click of the Refresh Button, I call a background program to reload/refresh the Order data. So I added code to set the "loadInvoiceWidgets" to "true" in the program.
      That did not work.

      From the Invoices App:
      image.png

      From Developer Tools you can see the app variable set. However, the widgets are not refreshing.
      (this app variable seems to always be "true")

      image.png

      To get this to work? I had to:

      1. Create a Public Event in my Orders app called refreshInvoices
      2. Fire that event on success of Refresh Button click

      Then:
      1. Listen for that event in my Invoices app
      2. Set the app variable loadInvoiceWidgets

      So I'm curious as to why it worked in the UI but not from the RPG program...


      ?

      Comment


      • #4
        I hope I am understanding correctly...I am assuming the your Order Entry program is calling the back-end program that was setting "loadInvoiceWidgets" to true. However, it looks like it is your other application (Invoices) that is looking for that app variable. So the loadInvoiceWidgets app variable is being set for the Order Entry application...not the Invoices application.

        Comment


        • #5
          That's exactly correct... So even though one app is running "inside" the other, only the app that called the backend program will observe the variable set.

          Thanks for the explanation!

          Comment

          Working...
          X