Run report "attempted to issue a client callback"

Alexander95Alexander95 Member Posts: 17
I am using a console application which runs specified reports/codeunits from Dynamics NAV 2013 version. The process is done by passing parameters down fromt he console application to the published web service. I can run some objects, but this one is causing me a bit of trouble to get going.

-OnPreReport-
rImportExportEngine.GET('Export');

tFileName := rImportExportEngine.GetFileName();

tSeparator := FORMAT('|');

// create file
CLEAR(fOut);
fOut.TEXTMODE := TRUE;
fOut.CREATE(rImportExportEngine."Folder Path" + tFileName);

-OnPostReport-

fOut.CLOSE;
COPY(rImportExportEngine."Folder Path" + tFileName,rImportExportEngine."Archive Folder Path" + tFileName);

The code did contain an excel buffer, but I removed it. Any clue would be great.

Answers

  • jglathejglathe Member Posts: 639
    Does rImportExportEngine.GetFileName() bring up a dialogue under some circumstances? Any GUI is not allowed.
  • RockWithNAVRockWithNAV Member Posts: 1,139
    client callback only comes up when there is some dialogue box that's comes up in between of the code which is being execute where GUI is not available.
  • Alexander95Alexander95 Member Posts: 17
    I have removed all code which would cause any dialogue boxes to come up. I am still getting the same error. At the moment, I can only think that the error is caused by a dialogue box which opens when running an object, trying to open the RTC. This is part of 2013 and is the same for all report objects in the classic client. Is there a way to run objects without having the RTC open as well as the classic client?
  • KishormKishorm Member Posts: 921
    Can you show the code for the rImportExportEngine.GetFileName() function?
  • Alexander95Alexander95 Member Posts: 17
    IF GUIALLOWED THEN BEGIN
    rImportExportEngine.GET('Item Export');
    tFileName := rImportExportEngine.GetFileName();
    END;
  • KishormKishorm Member Posts: 921
    What I want to see is the code in the GetFileName() function itself as this maybe causing the issue.

    It looks like you have changed the code in your report and that's now the code that calls the rImportExportEngine.GetFileName() function. If so then are you setting tFileName to something when GUIALLOWED is false - i.e. when it's running as a Web Service?
  • Alexander95Alexander95 Member Posts: 17
    This is the only part of the code which includes GetFileName(). There hasn't been any change from the original code as far as I'm aware, except for the fact I've included an IF GUI ALLOWED.
  • KishormKishorm Member Posts: 921
    Ok but what does the GetFileName() function actually do - it's the code inside this function that I'm asking you to share. It could be the code in there causing the error but without being able to see the code how can we know and therefore help?
  • Alexander95Alexander95 Member Posts: 17
    Sorry. I am still new to this so I did not fully understand what you were meaning. Here is the code from the GetFileName function

    EXIT(STRSUBSTNO("File Name",FORMAT(CURRENTDATETIME,0,"Date and Time Format")));
  • KishormKishorm Member Posts: 921
    That looks OK except for the fact that with the IF GUIALLOWED statement the tFilename never gets set when it gets run as a web service - you need to fix that.

    Now try commenting all the code in the OnPreReport and OnPostReport just to double check. If you still get the error then you know it's some other code causing the problem.
  • NAVRSNAVRS Member Posts: 7
    Just check the Copy statement , when system tries to execute copy files, throwing Clientcall back
Sign In or Register to comment.