Hi All,
How to get the form datasource method in modified eventhandler in class extension.
Please help me.
Thanks for your valuable reply.
*This post is locked for comments
Hi All,
How to get the form datasource method in modified eventhandler in class extension.
Please help me.
Thanks for your valuable reply.
*This post is locked for comments
Hi Arun,
You can use like that,
[FormDataFieldEventHandler(formDataFieldStr(InventTransferOrders, InventTransferLine, QtyTransfer), FormDataFieldEventType::Modified)]
public static void QtyTransfer_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
FormDataSource inventTransferLine_ds = sender.datasource();
InventTransferLine inventTransferLine = inventTransferLine_ds.cursor();
inventTransferLine .initvalue();
}
Thanks,
Prabakaran R.
try this
FormRun formRun = _sender.datasource().formRun();
FormDataSource ForecastSales_ds = = formRun.dataSource(ForecastSales')
In First line also i m getting error:
i just wrote the two lines of code.
which line you are getting this error ?
Thanks for reply.
Its throw error to me.
This is my scenario:
FormDataFieldEventHandler(formDataFieldStr(ForecastSales, ForecastSales, Currency), FormDataFieldEventType::Modified)]
public static void Currency_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
FormDataSource ForecastSales_ds =
sender.datasource(formDataSourceStr(ForecastSales, ForecastSales));
ForecastSales_ds.updateAmount();
}
its throw error FormDataObject.datasource,expect 0 arguments,but 1 specified
once you get the datasource just put datasource_ds.yourMethodname() . It doesn't show your method when you indent but it works
Hi Sukrut,
Thanks for your reply.
I already tried your suggestion but i cant able to call the datasource method.
please help.
Thanks
Arun Joseph A
Answer is already given . Did you check my reply ?
D 365
You can get formDatasource from sender as shown below
FormDataSource projTable_ds = sender.formRun().dataSource("ProjTable");
another way is
FormDataSource MyRandomTable_ds = sender.dataSource(formDataSourceStr(SomeForm, MyRandomTableDS)
Once you have formDatasource you can easily access its methods.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156