Notifications
Announcements
No record found.
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.
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.
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 StateError 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)
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 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
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 ,
After full model build, the method is displayed in the drop down as : InventOnhandItem_FormDataSource_Extension.expirationDate
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 Neeraj Kumar 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... 456 Super User 2025 Season 2
Martin Dráb 429 Most Valuable Professional
BillurSamdancioglu 239 Most Valuable Professional