'XXXXXXXX' is not a valid date. Error when generating a report in NAV.

Hi Guys,

Got this problem when generating a report from NAV 2009 RTC. (Please see attached file).

Report is actually in excel, NAV only fill's in cells of that excel file. Said report is a localized functionality of NAV 2009RTC.

Error only comes when the report is being generated from NAV RTC, however executing the same in NAV Classic does not show this error.

Would really appreciate your feedback


Thanks,

riel_mallorca

Comments

  • RockWithNAVRockWithNAV Member Posts: 1,139
    Hey Riel,

    As I can see its a genuine error for Date Data types though I don't know how its executing in classic or some different concept is running there as some time format is too coming with that. You may have to write some code like this and calculate your date manually.


    DateVariable := COPYSTR(IncomingDateFormat,9,2) + COPYSTR(IncomingDateFormat,6,2) + COPYSTR(IncomingDateFormat,1,4);

    EVALUATE(DateCalculated,DateVariable);
  • riel_mallorcariel_mallorca Member Posts: 2
    Hi RockwithNAV,

    I will have that one checked with our technical guy as I am functionally oriented.

    I am thinking it is some kind of related to the SQL date and time, as I tried restoring the latest backup of the database in my local computer and the reports are working.
    Also one more thing, the date that can be seen in the error message is the date of the local computer running the report.

    The report is called in the Page Action on a customized page, here is the code for that page action wondering if it would lighten you up on the root cause of my issue.


    RecBIRSetup.GET;

    IF RecBIRSetup."2307 Report" = 0 THEN
    ERROR(Text50000, '2307');

    RecWHTTransEntry.RESET;
    //RecWHTTransEntry.SETRANGE(RecWHTTransEntry.Type, RecWHTTransEntry.Type::"2307");

    IF RecWHTTransEntry.FIND('-') THEN
    RecWHTTransEntry.DELETEALL;

    Date2307 := DateFilter2307(optQuarter);

    //earl 20140515 start
    //cduBIRUtility.GetWHTEntry(Date2307, vPayorCode,1);
    IF NOT vPerInvoice THEN BEGIN
    cduBIRUtility.GetWHTEntry(Date2307, vPayorCode,1, '');
    END ELSE BEGIN
    recLPurchInvHeader.RESET;
    recLPurchInvHeader.SETFILTER(recLPurchInvHeader."No.", vInvoiceDocNo);
    recLPurchInvHeader.FINDSET;
    cduBIRUtility.GetWHTEntry('', recLPurchInvHeader."Buy-from Vendor No.",1, vInvoiceDocNo);
    END;
    //earl 20140515 stop
    COMMIT;

    RecWHTTransEntry.RESET;
    REPORT.RUN(RecBIRSetup."2307 Report", TRUE, FALSE, RecWHTTransEntry);


    Thanks,

    RIEL
  • RockWithNAVRockWithNAV Member Posts: 1,139
    Hey Riel,

    Yes please check this out with technical guy and ask him to compile the objects once.

    One hit and trial solution I can give you is to change the Date format of your machine from 08.10.2015 to 2015.08.10 and then try. Though NAV handles this in itself but you can try this once.

    I have many questions in the code that you have pasted, though they may not be related to the above issue but on code standards.

    RecBIRSetup.GET;

    IF RecBIRSetup."2307 Report" = 0 THEN
    ERROR(Text50000, '2307');

    RecWHTTransEntry.RESET; //
    //RecWHTTransEntry.SETRANGE(RecWHTTransEntry.Type, RecWHTTransEntry.Type::"2307");

    IF RecWHTTransEntry.FIND('-') THEN //
    WHTAS THE USE OF THESE LINES

    RecWHTTransEntry.DELETEALL;

    Date2307 := DateFilter2307(optQuarter); // WHATS WRITTEN INSIDE THIS FUNCTION

    //earl 20140515 start
    //cduBIRUtility.GetWHTEntry(Date2307, vPayorCode,1);
    IF NOT vPerInvoice THEN BEGIN
    cduBIRUtility.GetWHTEntry(Date2307, vPayorCode,1, '');
    END ELSE BEGIN
    recLPurchInvHeader.RESET;
    recLPurchInvHeader.SETFILTER(recLPurchInvHeader."No.", vInvoiceDocNo);
    recLPurchInvHeader.FINDSET;
    WHTAS THE USE OF THIS LINE, USE GET INSTEAD OF THESE 3 LINES
    cduBIRUtility.GetWHTEntry('', recLPurchInvHeader."Buy-from Vendor No.",1, vInvoiceDocNo);
    END;
    //earl 20140515 stop
    COMMIT; // IS THIS CODE WRITTEN FOR FORCEFUL TRANSACTION

    RecWHTTransEntry.RESET; [/s] WHTAS THE USE OF THIS LINE
    REPORT.RUN(RecBIRSetup."2307 Report", TRUE, FALSE, RecWHTTransEntry);
Sign In or Register to comment.