Notifications
Announcements
So I created a code extension to the InventItemPurchSetup table and created a mirror method of finding the lowest Qty to use in the ReqTranspo form inside a grid control(gridreqpo) I have rebuilt and it still doesn't recognize it. Is there something else special I need for it to access this method that I am not knowing about?
Once you rebuild, did you find only build successful or application pool recycling? If it is only build, there might some error. Can you check the error log?
If application pool recycle, then close and open the visual studio, then try referencing that method in form.
Hi Keith,
On the data method property try adding like InvenItemSetUpPurch_GrouPODEV_Extension::editMoQQty (ClassName::methodName).
If that doesn't work add the method on form DataSource extension class instead of table extension.
Thanks,
Girish S.
Hi, As Girish mentioned, you are not setting edit method correctly in form design. For methods added in extension have different way to setup.
Check this thread (screenshots) for reference
community.dynamics.com/.../678121
So I adjusted the DataMethod to add the extension(InventItemPurchSetup_GROUPODEV_Extension::getMOQQty).
I'm atleast getting an error on the site. Do I need to add this to the datasource extension now? Why would it now see this method?
"If that doesn't work add the method on form DataSource extension class instead of table extension."
I don't get an option to add a method to the form datasource extension class.
For that, You have to create a new extension class for Form DataSource.
check this article
dynamics365musings.com/.../
You mentioned 'I'm atleast getting an error on the site. '
What's the error?
Ok, so I think I got this added semi correctly.. I need to get the lowest qty from InventItemPurchSetup based on the ReqPo line itemid. It doesn't like the this variable.
[ExtensionOf(formDataSourceStr(ReqTransPo,InventItemPurchSetup))] final class ReqTransPO_IPSetup_Extension { display public QtyLowest getMOQQty(ReqPO _reqpo) { InventItemPurchSetup inventItemPurchSetupDefault; if (this.ItemId) { inventItemPurchSetupDefault = InventItemPurchSetup::findDefault(this.ItemId); if (inventItemPurchSetupDefault.RecId != this.RecId) { return inventItemPurchSetupDefault.LowestQty; } } return 0; } }
Use DatasourceName.ItemId instead of this keyword.
If the Datasource name doesn't work, try like below to get current cursor.
[ExtensionOf(formDataSourceStr(ReqTransPo,InventItemPurchSetup))] final class ReqTransPO_IPSetup_Extension { display public QtyLowest getMOQQty(ReqPO _reqpo) { InventItemPurchSetup inventItemPurchSetupDefault; //get the formrun FormRun frun = this.formRun(); //get the form datasource FormDataSource fds = frun.datasource("DataSourceName"); //get the current buffer TableName name = fds.cursor(); return 0; } }
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…
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 663 Super User 2026 Season 1
Abhilash Warrier 289 Super User 2026 Season 1
Martin Dráb 232 Most Valuable Professional