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

  • brent_quick Profile Picture
    brent_quick 180 on at
    RE: RptCompany table with multiple entries doubling or tripling records.

    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.

  • Mark E Profile Picture
    Mark E 6,431 on at
    RE: RptCompany table with multiple entries doubling or tripling records.

    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
    brent_quick 180 on at
    RE: RptCompany table with multiple entries doubling or tripling records.

    Opened support ticket but denoted it as a bug submission.

    Incident 116011113568882

  • brent_quick Profile Picture
    brent_quick 180 on at
    RE: RptCompany table with multiple entries doubling or tripling records.

    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
    brent_quick 180 on at
    RE: RptCompany table with multiple entries doubling or tripling records.

    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

  • Verified answer
    Mark E Profile Picture
    Mark E 6,431 on at
    RE: RptCompany table with multiple entries doubling or tripling records.

    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.

  • Ram Peru Profile Picture
    Ram Peru 2,830 on at
    RE: RptCompany table with multiple entries doubling or tripling records.

    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans