Announcements
Hello.
Is it possible to add a display method in a form datasource through extension and then use it as a data method on new control added to the same form (through extension) ?
Example:
[ExtensionOf(formDataSourceStr(formname,formdatasourcename))]
final class ABCDatasource_Extension
{
public display str showString()
{
return "test" ;
}
}
Then I add new string control to the "formname" by creating an extension of the form. I want to use showString display method as a data method for this control.
I'm getting compilation error: the method doesn't exists.
I try to use COC as much as possible and to avoid static methods.
There is similar discussion here :https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/311051/can-i-add-a-new-display-method-under-a-datasource-of-a-form-extension/, but It's an old thread.
Thank you.
Hi ,
After full model build, the method is displayed in the drop down as : InventOnhandItem_FormDataSource_Extension.expirationDate
It had worked for me a couple of weeks back when it showed the data method in the drop down. Could you try doing a build of your Dev model and check if that gets the drop down working?
Hi Gunjan,
It's working if you provide the full path to the method as you said : InventOnhandItem_FormDataSource_Extension.expirationDate
I was expecting to see the method in the drop down, but it's not listed
Thank you.
Hi FlorinF,
You should be able to choose the data method from the drop down. You can try this value as well - InventOnhandItem_FormDataSource_Extension.expirationDate
Hi Martin ,
I have the following code :
[ExtensionOf(formDataSourceStr(InventOnhandItem, InventSum))]
final class InventOnhandItem_FormDataSource_Extension
{
display date expirationDate(InventSum _inventSum)
{
return today();
}
}
The error is :
Severity Code Description Project File Line Suppression State
Error Path: [AxFormExtension/InventOnhandItem.xx/Controls/FormExtensionControlk0ln0vls1/ExpirationDate/DataMethod]:The data method 'expirationDate' was not found on the data source 'InventSum' or its base table/view.
My version is:
Application release
Microsoft Dynamics 365 for Finance and Operations (10.0.15)
If I'm not mistaken, it's supported now, although it wasn't possible in some older versions of D365FO.
Neverthelss your method isn't correct - if a display method isn't on a table, it must take a table buffer as the parameter.
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... 290,186 Super User 2024 Season 2
Martin Dráb 227,996 Super User 2024 Season 2
nmaenpaa 101,148