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 :
Microsoft Dynamics SL (Archived)

RptCompany table with multiple entries doubling or tripling records.

(0) ShareShare
ReportReport
Posted on by 180

Client upgraded from 7.0FP1 to 2015 CU1 and has an on again off again problem with some reports.  Basically the records returned are doubled or tripled without any clear cause.  I had thought it was some of the pre-execution SP's populating views and another user running same report or similar, but client didn't want me to dig too deep.  I set the reports that were known to have issues commonly to DISTINCT in Crystal and moved on.

Client is now reporting it more commonly and most recently PA150.rpt (Project Transaction) was found to have the problem.  In checking it has an EXE (GRRSW00) but no stored procedure.  Pulling the SQL from Crystal and running it I could see duplicated records being returned.  Digging in more it seems the following JOIN was the source of the duplication:

INNER JOIN "CompanyAppDB"."dbo"."RptCompany" "RptCompany" ON "pjtran"."CpnyId"="RptCompany"."CpnyID

So looking at RptCompany records when two reports (same or different) are being run there are multiple entries like the following:

CpnyID                        CpnyName                RI_ID              tstamp
0000                            Company                  3                    0x0000000004CB77F8

0000                            Company                  4                    0x0000000004CB780A

So question is why multiple entries or why does SL not handle the multiple entries?

Thanks



*This post is locked for comments

I have the same question (0)
  • Ram Peru Profile Picture
    2,830 on at

    Hello Brent,

    RptRunTime and RptCompany are those tables table contains a record for each report process that occurs. The record exists only for a short time while the report is processed, and then is deleted.

    Following scenarios might have happened for records not getting deleted from those two tables

    1. Report has been crashed after the Print Preview button clicked. At the time record might have stayed there in those tables without deletion

    2. User might have closed the report using task manager/other options

    You can follow the below steps to solve this issue

    • Take a backup of  RptCompany table & RptRunTime table

    • Delete the records from RptCompany table & RptRunTime table

    • Now run the report PA150

    Hope this helps. Please try those steps and let me know how it goes.

  • Verified answer
    Mark E Profile Picture
    6,451 on at

    It appears that in some of SL 2015 reports, the RptCompany table was added for Multi-Company reporting capabilities, but what was forgotten by development was to add the following to the Record Selection Formula in each report:

    {RptCompany.RI_ID}=tonumber(riparam("RI_ID"))

    This assures that the data returned is only relevant to the reporting session (RI_ID) that initiated the request.  Unless this had already been written up as a bug, it should probably be submitted as one.

  • brent_quick Profile Picture
    180 on at

    Mark - I agree that would be a solution since the RI_ID flag is present.  The thought of having to modify all reports to include this in the SQL code (via Crystal 8) is probably not going to happen.  As to submitting as a bug I will see what I can do but if you have a short path to getting this done please let me know since I am not on the ERP team but no one else was willing to take a SL 7 - 2015 upgrade!

    Thanks

  • brent_quick Profile Picture
    180 on at

    Perumalsamy - tables get values when two people are running reports at same time and Mark has the reason this modifies the record count.

    Thanks

  • brent_quick Profile Picture
    180 on at

    Opened support ticket but denoted it as a bug submission.

    Incident 116011113568882

  • Mark E Profile Picture
    6,451 on at

    Brent,

    Glad you got it submitted.  To address your "short path" request, I don't think there is one.  You'll either need to add the formula to each affected report, or wait until MS issues a HF for the problem.

    If you are looking for assistance in getting the formula added to the affected reports, let me know and I would be glad to provide you with a quote.

  • brent_quick Profile Picture
    180 on at

    Mark,

    The bug number is 35385.  As to fixing, I appreciate the offer to help but I can do it.  Getting the client to pay is where the problem would be.  They are going to work around it (per report Distinct) or waiting to run the report when no one else is running one.

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 > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans