Jump to content
We've recently updated our Privacy Statement, available here. ×

New RefreshOnDemandData(callback) does not pass an exception parameter to the callback unlike the obsoleted RefreshAsync. Is there an equivalent ?


Gaspard Martin-Jouannaud

Recommended Posts

I was using the RefreshAsync method and noticed it has been obsoleted so I tried using the recommended RefreshOnDemandData however when passing a callback function to it it does not pass an exception parameter unlike RefreshAsync.

old syntax:

notify = Application.GetService[NotificationService]() def execCallBack(exception, Document=Document, notify=notify): if not exception: Document.ActivePageReference = Document.Pages[Document.Pages.IndexOf(Document.ActivePageReference) + 1] else: notify.AddErrorNotification("Error refreshing table","Error details",str(exception)) Document.Data.Tables.RefreshAsync([Table], execCallBack)

New syntax:

notify = Application.GetService[NotificationService]() def execCallBack(exception, Document=Document, notify=notify): if not exception: Document.ActivePageReference = Document.Pages[Document.Pages.IndexOf(Document.ActivePageReference) + 1] else: notify.AddErrorNotification("Error refreshing table","Error details",str(exception)) Table.RefreshOnDemandData(execCallBack) # TypeError: execCallBack() takes exactly 1 argument (0 given)

Is there a way to check if the table loaded without an error with the new method ?

Link to comment
Share on other sites

Hello Gaspard.

From what I can find out, if you have used RefreshAsync before, the closest current equivalent should be ReloadLinkedData or ReloadAllData. Issues there are reported in Notifications.

The RefreshOnDemandData method(s) does indeed not pass exceptions though. A request for that would be an idea, something you could create in the Ideas Portal: https://ideas.tibco.com/ideas (the more information about your use case that you include, the better)  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...