Refresh edit screen of one entity with the value change of another entity

How to refresh an edit page of 1 entity when a value is changed in another entity…??
For example, I have an order entity, when a customer orders a product its available stock should be decreased from the inventory table. The value is getting decreased from the inventory table but it is reflected in a currently opened inventory edit screen only if we close the inventory table and open it again… I tried to refresh the datasource but it is not working…

Thanks and regards…!!

Hello @aiswarya

Could you clarify what problem you faced with? You cannot trigger editor refresh or refreshing doesn’t lead to any updates in UI?

Regards,
Daniil

Hi,
I reduces the available stock of a product from the inventory table when a product is ordered. This code is written in order listener.The inventory and order are 2 different tables. The value of inventory table is not refreshed automatically. I need to close and open the inventory browse inorder to the view the updated value of availablestock.
Thanks…!!
@tsarev

Have you tried to use our Global Events addon? It seems that it’ll help you to solve the problem - just fire an event and refresh data when event received.

You can find a demo here: Global Events Add-on Demo.

Regards,
Daniil