Skip to main content

Notifications

Announcements

No record found.

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

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!");
    }
}

  • Verified answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\De

    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.

  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\De

    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.

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\De

    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
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\De

    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.

  • Laraib Profile Picture
    Laraib 131 on at
    RE: Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\De

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

  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\De

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

    What exactly did you compile?

  • Laraib Profile Picture
    Laraib 131 on at
    RE: Error executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScreen\Designs\De

    I have tried compiling but it is giving me same error

  • Martin Dráb Profile Picture
    Martin Dráb 230,214 Most Valuable Professional on at
    RE: rror executing code: SLAIFTimesheetImport (object) has no valid runable code in method 'importAndParseAttendanceFromUtility'. Stack trace (C)\Classes\SLAIFTimesheetImport\importAndParseAttendanceFromUtility (C)\Forms\SLPRLAttendanceImportScre

    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.

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans