Skip to main content

Notifications

Announcements

No record found.

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 Microsoft Employee

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

  • Martin Dráb Profile Picture
    Martin Dráb 230,445 Most Valuable Professional on at
    RE: Can't make a simple Select Statement, missing dll reference in Visual Studio 2015 Pro

    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.

  • vipin Profile Picture
    vipin 5 on at
    RE: Can't make a simple Select Statement, missing dll reference in Visual Studio 2015 Pro

    Works like a charm. Thanks Joe !!

  • Verified answer
    JoeBrewer Profile Picture
    JoeBrewer 690 on at
    RE: Can't make a simple Select Statement, missing dll reference in Visual Studio 2015 Pro

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans