Hi,
I'm working on Expense Reports (TrvExpenses) form.
Our requirement is:
When Map to travel requisition field is modified, we need to delete the Expenses lines, then replace the lines with records from Travel requisition lines. User will need to update Financial dimensions values afterwards.

Expense report header (TrvExpTable) has a method called changedRequisition(), which is by default being called when Map to travel requisition is modified. So we extended this method and implement our delete & insert logic here in this table method.
For the form refresh, we tried calling formrun.Task(#taskRefresh) method in form OnActivated event.
The refresh works.However, form OnActivated is being triggered too often, and this is blocking user from navigating to Financial dimensions tab. Every time we try to click on Financial dimension tab, the form OnActivated is triggered and then we lost focus.
Then we tried calling TrvExpTable_ds.research(), TrvExpTrans_ds.research, TrvExpTable_ds.ExecuteQuery(), TrvExpTrans_ds.ExecuteQuery(), but all in vain.

The lines are not refreshed at all. Need to refresh browser only then we can see the changes.

How can we achieve this requirement? Please help me with more ideas.
Thank you.