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 :
Finance | Project Operations, Human Resources, ...
Answered

Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\Design

(0) ShareShare
ReportReport
Posted on by 131

I am trying to import excel file but it is giving me this error 

Import time and attendance

following are the code of relevant class with its compilation error

public void importAndParseAttendanceFromUtility()
{

    int                     rowsAffected = 0;
    Filename                fName;
    SLTimeImportTable       slTimeImportTable;
    //below line is giving following error "Variable has not been declared."
    ImportUtilityZKK.Import   importObj;
    
    importObj = new ImportUtilityZKK.Import();

    fileName = importObj.ReadImportConfig(curext(), sessionId(), curUserId());

    if (fileName != "")
    {
        delete_from slTimeImportTable
            where slTimeImportTable.UserId == curUserId()
            ||   slTimeImportTable.SessionId == sessionId();

        importObj.ParseAttendanceFile() ;


    }
    else
    {
        info("Failed to import records!");
    }
}

I have the same question (0)
  • Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    The answer is the same as in your previous thread about the same error, which we discussed just a short while ago. Compile the code and fix compilations errors (if any).

    If it's newly written code, you're forgetting compilation. If you're not developing anything, then the environment hasn't been set up correctly. You should review your deployment procedures.

    By the way, could you please use shorter thread titles? Details such as the stack trace belong to the thread body, not to the title.

  • Laraib Profile Picture
    131 on at

    I have tried compiling but it is giving me same error

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

    What was the result of the compilation? Did it find any errors?

    What exactly did you compile?

  • Laraib Profile Picture
    131 on at

    I have compile SLPRLAttendanceImportScreen and i gives me error "Variable  ImportUtilityZKK.Import has not been declared ".

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

    As I said, you must fix compilation errors. You are currenctly unable to compile your code, therefore trying to run it is just a waste of time.

    The type name (ImportUtilityZKK.Import) suggests that you're trying to use a .NET library. First of all, review that the name is correct. Make sure that you didn't forget any namespace. If the name is correct, it seems that you haven't installed the library into your environment.

    Please tell us whether you're trying to add a DLL file or you have the library defined in a Visual Studio project added to AOT.

  • ergun sahin Profile Picture
    8,826 Moderator on at

    There used to be a working build, but did it give an error when you compile it?

    Then, it is a client-side class and cannot access the ax dll file on your machine (or the machine you are connected to).

    Add the related dll to the Client bin Folder and try to compile it again (you may need to restart the AOS)

    The fact of the matter is that the background is a bit more complicated than I explained, if there is an machine that has been successfully compiled before, compile it there.

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

    You shouldn't install the DLL manually if it comes from a Visual Studio project added to AOT. In such a case, you should review the deplyment targets and compile the project - the deployment (to VSAssemblies folder) will be done automatically.

    That's why I asked about which case it is.

  • Verified answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    Yes, but I felt like Laraib was dealing with a completely different development, compiling the relevant class and getting this error.

    Let's think it as a Visual Studio project. What Laraib should do is right click/edit on that project. Compiling/deploying the project after making sure of its deplyment targets.

    But my guess is this is an old dll and probably there is no microsoft dynamics ax visual studio development tools in the environment (hot-swapping etc.)

    I think Laraib is not dealing with the dll itself, just trying to get past the error. So I just focused on compiling

    Of course, these are all conjectures. If it is a new development with this dll, you will have to go through these steps.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans
Liquid error: parsing "/blogs/post/?postid=%27nvOpzp;%20AND%201=1%20OR%20(%3C%27%22%3EiKO))," - Too many )'s.