web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Can't make a simple Select Statement, missing dll reference in Visual Studio 2015 Pro

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Verified answer
    JoeBrewer Profile Picture
    692 on at

    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

  • vipin Profile Picture
    5 on at

    Works like a charm. Thanks Joe !!

  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    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.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans