Announcements
No record found.
Hi all,
I hav a Form name MyForm with Datasources DSA, DSB. i will type a value in DSA-field1. now i need to assign this value in DSB- field2. i am trying in FormDataFieldEventhandler.
how to fetch other datasource record (DSB) here while modifying DSA-fieldlevel.
Any suggestions plss.
Thanks in advance,
Hi Test Bot,
If MyForm is your own form, you don't need to use event handlers. Use methods on form instead.
I would recommend using 'write' method on DSA data source and after 'super' statement update value in DSB table with update_recordset statement and refreshing DSB data source.
Why do you want to duplicate this value in the other table / data source? Normally you should try to avoid that, instead store the data in one place and access it via table relations from other places.
Anyway, if you do, and if it's your own form, you don't need to use event handlers (as Sergey mentioned).
And you could also consider putting the code in insert and update (and delete?) methods of the table, instead of the form. This way the logic would work from any process that writes into that table.
Hi Nikolaos and Sergei,
thanks for your suggestions .
Its a standard form. i need at form level modifying the data.
In this case, I still suggest using "OnWritten' event and update_recordset with DSB data source refresh option. In this case, if user will change values several times, you don't need to do unecesary updates to DSB before user decide to fix changes.
You could use the below code, SalesTable>DSA ,SalesLine>DSB:
[FormDataFieldEventHandler(formDataFieldStr(SalesTable, SalesTable, AccountingDistributionTemplate), FormDataFieldEventType::Modified)]
public static void AccountingDistributionTemplate_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
FormRun formRun = sender.datasource().formRun();
FormDataSource salesline_ds = formRun.dataSource("SalesLine");
salesline_ds.yourfield=......
}
Hi Mattguo,
Thanks . it worked.
Hi Sergio,
i will try your suggestion as well. thanks for the quick reply.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 239 Super User 2026 Season 2
Aayush Tiwari 221
Subra 166 Super User 2026 Season 2