Notifications
Announcements
No record found.
I’m new to Development in D365FO. I’m following the post https://community.dynamics.com/ax/b/axinthefield/posts/using-azure-application-insights-to-monitor-license-usage-in-d365-finance-and-operations
But I’m getting compile errors below.
Severity
Code
Description
Project
File
Line
Suppression State
Error
Table 'AppInsightsParameters' does not contain the static method 'find'.
FinanceOperations1 (USR) [TestModel]
C:\AOSService\PackagesLocalDirectory\Bin\XppSource\TestModel\AxClass_CPR_VendEditInvoice_Form_Extension.xpp
11
This is obvious that I don’t have find method because it is a custom table. But I’m not sure how do I add a find method? Can anyone help me please?
Hi Jacky Sam,
Most out-of-the-box tables include a find method, which you can use as a reference to create your own. The link you are referencing is for completely different requirement.
thanks,
Arun
Here is a sample: Table name is PayrollPeriod
static PayrollPeriod find(RecId _recId, boolean _forUpdate = false) { PayrollPeriod payrollPeriod; if (_recId) { payrollPeriod.selectForUpdate(_forUpdate); select firstonly payrollPeriod where payrollPeriod.RecId == _recId; } return payrollPeriod; }
Thanks Komi, i followed your suggestion and i was able to add a find method based on Recid. I didn't create any unique index on my table, i'm just passing recid as parameter in find method. is it fine?
For a common table its Ok, but do you have RecId on hand (When you called find method).
If I m not wrong you are trying create a parameter table. This tables generaly has only a row data so find method a little different (You dont need RecId)
public static ParameterTable find(boolean _update = false) { ParameterTable parameter; parameter.selectForUpdate(_update); select firstonly parameter index KeyIdx where parameter.Key == 0; if (! parameter && ! parameter.isTmp()) { Company::createParameter(parameter); } return parameter; }
By the way, you can learn more about parameter tables in Parameter System Design Pattern.
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.
Martin Dráb 544 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader