Hi experts,
I'm trying to do a simple implementation of a old simple script that select data from a Table present in Dynamics AX 7. My target is to create a Runnable Class (Job) similar as I've done with the Development Workspace in AX 2012 R2. The script that works in AX 2012 is the following:
static void Intro_Select(Args _args)
{
SalesLine salesLine;
select count(RecId),sum(SalesQty) from salesLine;
info(strFmt("Number of Records : %1 Total Quantity : %2",SalesLine.RecId,SalesLine.SalesQty));
}
Then, I've created a script equivalent in my Runnable Class (Job) in my Visual Studio 2015 Professional Solution is the following:
class Intro_Select
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
SalesLine salesLine;
select count(RecId),sum(SalesQty) from salesLine;
info(strFmt("Number of Records : %1 Total Quantity : %2",SalesLine.RecId,SalesLine.SalesQty));
}
}
The problem is when I build it and then run. It appears the following error message:
Severity Code Description Project Project Rank File Line Column Suppression State
Error A reference to 'Dynamics.AX.Directory, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is required to compile this module. DevelopmentBasicsFMSProject (USR) [DevelopmentBasicsFMS] 1 C:\AOSService\PackagesLocalDirectory\bin\XppSource\DevelopmentBasicsFMS\AxClass_Intro_Select.xpp 7 5
I've tried to search many search results from Google and none gives me an answer to where I could find the missing dll or where I could download the missing dll or even how to solve my issue. I didn't think that it was this difficult to make a simple select statement in Dynamics AX 7.
Can you guys help me out? What I should download or make sure I have in my VM? Can you provide me a path or relative path that I can find the reference to add to my project? Can you guys please address me where or what I must import from "Tools>Extensions and Updates"?
Best regards and good luck for all in your individual businesses,
Miguel Braga
*This post is locked for comments
When somebody answers your question, mark it as verified by using "Did this answer your question?" beside the reply. It makes clear that the thread doesn't require attention anymore and people with the same question can easily locate the answer.
I've done it for you this time.
Works like a charm. Thanks Joe !!
Hi Miguel
It looks like it is telling you to add the package "Directory" to your model - have you done this?
From the Model Management menu in the Dynamics 365 menu in visual studio, select update model parameters. Choose your model, click next and then select directory from the list.
Joe
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,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156