Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

An exception occurred in the query metadata execution. The exception is Map object not initialized.

Posted on by 321

8420.Error.jpg

*This post is locked for comments

  • Suggested answer
    Logger Profile Picture
    Logger 60 on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    It's a bug.

    The tempDBTableNamesMap variable was not initialised in \Classes\SrsReportProviderQueryBuilder\initializePreProcessedDetails   for preview mode.

    I fixed this issue for Dax 2012 R3 CU13

    You need to customize

    \Classes\SrsReportProviderQueryBuilder\initializePreProcessedDetails

    private void initializePreProcessedDetails()
    {
    #SRSFramework
    RecId preProcessedRecId;
    str preProcessedRecIdStr;
    Container tempDBTableNames;
    int idx, size;

    // if pre-processed report, get the table record here
    if(reportProviderMetadata.isPreProcessingRegular() || reportProviderMetadata.isPreProcessingTempDB())
    {
    // If running in preview mode, get the details table without the RecId
    // Find by name for the RDP name, inPreviewMode, this will provide the record from the previous run to ensure we clean it up.
    if(isPreviewMode)
    {
    // this can be empty if no record exists for previous run of previewMode.
    preProcessedDetails = SrsReportPreProcessedDetails::findByName(reportProviderName, true);

    // JEV005559, PKoz 27.11.2020 -->
    /*
    (S)\Classes\SrsReportProviderQueryBuilder\addTempDBCursorToQueryRun - line 18
    (S)\Classes\SrsReportProviderQueryBuilder\getQueryRun - line 28
    (S)\Jobs\
    . SrsRevenueReport_MRC.ChartDesign [Preview] 0 0

    */

    if (!tempDBTableNamesMap)
    {
    tempDBTableNames = preProcessedDetails.TempDBNames;
    size = conLen(tempDBTableNames);

    // if preprocessing is of TempDB type, and container size less than 2, then something went wrong..error out
    if(reportProviderMetadata.isPreProcessingTempDB())
    {
    if(size < 2)
    {
    throw error(strFmt("@SYS4007195", preProcessedRecIdStr));
    }
    else
    {
    tempDBTableNamesMap = new Map(Types::String, Types::String);
    for(idx = 1; idx <= size ; idx+=2)
    {
    // AOT TempDBName, SQL tempDB name
    tempDBTableNamesMap.insert(conPeek(tempDBTableNames, idx), conPeek(tempDBTableNames, idx+1));
    }
    }
    }
    }
    // JEV005559, PKoz 27.11.2020 <--
    }
    else
    {
    // get the pre-processed details table record.
    if(reportProviderParameters.exists(#RdpPreProcessedIdParameter))
    {
    preProcessedRecIdStr = reportProviderParameters.lookup(#RdpPreProcessedIdParameter);
    preProcessedRecId = str2int64(preProcessedRecIdStr);
    preProcessedDetails = SrsReportPreProcessedDetails::findByRecId(preProcessedRecId, reportProviderName);

    tempDBTableNames = preProcessedDetails.TempDBNames;
    size = conLen(tempDBTableNames);

    // if preprocessing is of TempDB type, and container size less than 2, then something went wrong..error out
    if(reportProviderMetadata.isPreProcessingTempDB())
    {
    if(size < 2)
    {
    throw error(strFmt("@SYS4007195", preProcessedRecIdStr));
    }
    else
    {
    tempDBTableNamesMap = new Map(Types::String, Types::String);
    for(idx = 1; idx <= size ; idx+=2)
    {
    // AOT TempDBName, SQL tempDB name
    tempDBTableNamesMap.insert(conPeek(tempDBTableNames, idx), conPeek(tempDBTableNames, idx+1));
    }
    }
    }
    }
    else
    {
    throw error("@SYS334989");
    }
    }
    }
    }

  • Verified answer
    Abdelrhman Hiba Profile Picture
    Abdelrhman Hiba 321 on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    the main problem from scratch

    I wanted to build a Report Based on RED Class

    when preview data in VS (SSRS Report) There was a specific field whose value does not come and this error message appears

    But after asking the question her and the hints that you have referred to my

    Traced the source of the error and was of that type EDT of that filed its different from another EDT for Actual Field in the original table

    that all (Different in EDT of filed in the TempTable) :D

    That's exactly what happened
    I hope that the answer will be satisfactory to everyone

    Regards 

    Abdelrhamn Hiba

  • Khurshid Wali Profile Picture
    Khurshid Wali 922 on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    How did you solve this problem? Please share with community. 

  • Abdelrhman Hiba Profile Picture
    Abdelrhman Hiba 321 on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    thank for hint 

    the problem is solved 

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    What kind of datasource have you used? A query or an RDP class? What can you tell us about it?

    Have you tried to debug or review the class throwing the exception?

  • Suggested answer
    Khurshid Wali Profile Picture
    Khurshid Wali 922 on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    Hi Abdelrhman,

    Your Question is still not clear.

    Normally this problem arise when you forgot to set SRSReportQueryAttribute(queryStr(_____)), attribute in your DP class.

    Try to Run the report and Share Info log error message.

  • Abdelrhman Hiba Profile Picture
    Abdelrhman Hiba 321 on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    Dear, Martin

    Firstly want thank you a lot for respond

    And am sorry for intrubtion

    Explain the problem :

    Whene i want to preview report in vs after design and connect with data source and select fields of report

    .

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: An exception occurred in the query metadata execution. The exception is Map object not initialized.

    I don't see any text explaining what you're doing when you got this error. Can you add it, please?

    Also, next time, please select only categories related to your thread, not every single category. For now, I've removed everything except of Development / Customization / SDK and Reporting and BI.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans