Hello,
Is it possible to refresh/reread datasource 'SalesLine' in 'SalesTable' form?
[DataEventHandler(tableStr(SalesLine), DataEventType::Updating), SuppressBPWarning('BPParameterNotUsed', 'False positive')] public static void SalesLine_onUpdating(Common sender, DataEventArgs e) { SalesLine salesLine = sender as SalesLine; //some logic }
Thanks.
Hi Shooowtek,
You are asking how to refresh SalesLine in SalesTable form. But your code seems to be event handler for table. Can you elaborate more?
From my knowledge it's not possible to get the DataSource buffer inside the table event handler.
Thanks,
Girish S.
Hi, Is this event handler from Form datasource or table level?
Try calling like salesLine.reread(); This will refresh that table with the present data.
On the SalesTable form, I update one field on the sales order lines. And it is required to refresh the SalesLine data on this form after this change.
I know that this can be done easily through FormDataFieldEventHandler, but I can't use that because it has to be done directly on the table. Therefore, I use DataEventHandler.
Can you please provide more details on why it has to be done directly on the table. I doubt if we can refresh form datasource from table level.
OK, I will try to solve differently to this problem and better try to the form.
So, If by making a change to a field value on the SalesTable form and datasource SalesTable, can I able to refresh of the other source - SalesLine?
[FormDataFieldEventHandler(formDataFieldStr(SalesTable, SalesTable, MyField), FormDataFieldEventType::Modified), SuppressBPWarning('BPParameterNotUsed', 'False positive')] public static void MyField_do_OnModified(FormDataObject sender, FormDataFieldEventArgs e) { FormDataSource salesTable_ds = sender.datasource(); FormDataSource salesLine_ds = sender.datasource("SalesLine"); //How to get SalesLine datasource?? SalesTable salesTable = salesTable_ds.cursor(); if(salesTable.orig().MyField != salesTable.MyField) { salesTable_ds.refresh(); salesTable_ds.research(true); salesLine_ds.refresh(); salesLine_ds.research(true); } }
There is a method doRefresh in SalesTable Form, you can try calling this method and pass parameter _lineRefreshNeeded as True.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 701 Super User 2025 Season 2
Martin Dráb 588 Most Valuable Professional
Sumit Singh 544