Hi,

We have a webblock with a structure list as an input parameter. After doing the necessary data updates we:

1 - click the save button;

2 - the save screen action is called; which will save the data via a REST API method and then trigger a notify;

3 - in the parent webscreen onnotfy action linked to the webblock we retrieve the latest data via the an REST API method; 

4 - we assign the output of the API to the list that is used in the webblock as an input parameter and then refresh the webblock;

Problem: We don't see the updated data;

What we've noticed: In debug mode we will see the updated information or if we refresh the screen after a couple of seconds;


Any suggestions on how to overcome this?

Thanks in advance.

Hi Ricardo, are you refresh the widgets to reload with the new data?

This is Traditional Web or Reactive? Can you update the oml?

Hi Ricardo, 

Call CommitTransaction action after you save the data.

it will solve the issue.

Hi again,

It's a traditional web app (OS 10) and yes I can update the OML. I will try commiting the transaction and if it works I'll be sure to mark it as the solution. Thanks

Ricardo de Freitas wrote:

Hi again,

It's a traditional web app (OS 10) and yes I can update the OML. I will try commiting the transaction and if it works I'll be sure to mark it as the solution. Thanks

After tell us if the solution of Assif works, I'm septical cuz if you are calling the API I'm assuming the data is already committed in that transaction


Morning,

I tried commiting the transaction and it unfortunately did not work. I was also sceptical as I believe APIs have parallel transactions - as you mentioned Carlos.

I will keep on trying however if someone else has any other suggestions please feel free to share them.


Regards,

Ricardo

Ricardo de Freitas wrote:

Morning,

I tried commiting the transaction and it unfortunately did not work. I was also sceptical as I believe APIs have parallel transactions - as you mentioned Carlos.

I will keep on trying however if someone else has any other suggestions please feel free to share them.


Regards,

Ricardo

upload the oml and we can try to help you


Unfortunately I can't as it belongs to a client - if I manage to create a simple example in my personal I will share it here but not sure if I'll have time today.

Ricardo de Freitas wrote:

Unfortunately I can't as it belongs to a client - if I manage to create a simple example in my personal I will share it here but not sure if I'll have time today.

Ok


Ricardo de Freitas wrote:

Hi,

We have a webblock with a structure list as an input parameter. After doing the necessary data updates we:

1 - click the save button;

2 - the save screen action is called; which will save the data via a REST API method and then trigger a notify;

3 - in the parent webscreen onnotfy action linked to the webblock we retrieve the latest data via the an REST API method; 

4 - we assign the output of the API to the list that is used in the webblock as an input parameter and then refresh the webblock;

Problem: We don't see the updated data;

What we've noticed: In debug mode we will see the updated information or if we refresh the screen after a couple of seconds;


Any suggestions on how to overcome this?

Thanks in advance.

BTW after you complete your flow you, leave the page and come back, check if the date is updated? if yes is some widget you arent refreshing in the screen


Good idea but I don't think that is the problem, if it was then it wouldn't even work in debug mode. 

Hi folks, 

I came acrossa quite similar case where I was saving sime data n then calling a Rest Api of another module. And the issue which I was facing is the data which I stored before calling api was not getting reflect when the action under Rest Api execute.

And hence using the CommitTransaction in my case before calling Rest, helped me.



Ok after lots of trial and error I tried adding a small timeout after saving the data which of course is not a reliable solution. With the timeout the data was presented correctly after the AJAX refresh. Spoke to the API team and seems that they save things asynchronously (even though it take less than a second). So mystery solved as to why it's happening, however I still don't know how to overcome this without using a timeout...

Ricardo de Freitas wrote:

Ok after lots of trial and error I tried adding a small timeout after saving the data which of course is not a reliable solution. With the timeout the data was presented correctly after the AJAX refresh. Spoke to the API team and seems that they save things asynchronously (even though it take less than a second). So mystery solved as to why it's happening, however I still don't know how to overcome this without using a timeout...

It makes sense cuz from the time you save to the time you refreshs the widget, the API could be taken the old data.

Good you have this solved, good code!


Happy to know :) You fixed the same.

Perhaps an interesting usecase.

Thanks Ricardo & Carlos