Question

Is there an event for the change of the masterview.current

  • 10 November 2023
  • 7 replies
  • 57 views

Userlevel 2
Badge

I have a screen with an masterview and some virtual DACs which are filled by data got from API requests. Now i need to be informed of the change of the masterviews current record to refresh the virtual DACs. Is there an event i can use for this purpose?


7 replies

Badge +11

I believe RowSelected of the masterview DAC would serve this purpose.

Userlevel 2
Badge

@darylbowman sadly not. It’s triggered for every record in the DAC.

Userlevel 7
Badge +9

@priekenberg40 I couldn’t underestand your question very well but if you are updating any given record either from API, manually, Import Scenario, … it will result in trigeering RowUpdated event and current record in cache will be the updated record. So if this is the case then on your MasterView RowUpdated you can refresh the virtual views using [Base. if needed]YourVirtualView.View.RequestRefresh();

If your case has different requirement please explain further.

Userlevel 2
Badge

@aaghaei i have a masterview DAC with basic information and dependant data fetched by API which are stored in virual DACs which are shown in different Tabs. If i now switch my masterview by using the navigatin buttons on the top i have to refetch the API data. But sometimes masterview.current is set to the wrong record.

Userlevel 7
Badge +9

@priekenberg40 If you want to refresh dependent views even if masterview is not modified then your only option is to use RowSelected as @darylbowman mentioned. Also if you have defined your keys correctly and defined the parent-child relationship in the views and enabled the SuncPosition in UI, even without ReuestRefresh your dependent data will be refreshed. Without your custom code review I am not sure if people in communinty can be more helpful.

Userlevel 2
Badge

@aaghaei If i change the tabs on the UI a refresh of the virtual DAC is done but as masterview.current points to a wrong record this will fetch the wrong data. My code has no chance to know which is the current masterview record wich is presented to the user.
If i find some time, i’ll prepare a minimal custo.

Userlevel 7
Badge

Hi @priekenberg40 were you able to find a solution? Thank you!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved