I believe I did this… Primarily through trial and error yesterday. At least the error messages in the System Monitor were close enough to give me a clue.
Frustration Point: Just venting for now. I have virtually no access to the database. We are dedicated cloud and have access to a replication of production only. No access to the reporting database. No access to the Pilot database. No access to the Pilot reporting database. No access to the schema in SSMS. I don’t understand the reason we cannot have a read only SQL account for debugging purposes, especially as we are dedicated. Of course I’m making the assumption dedicated has their own database vs. multi-tenant. I came from an on prem environment, where SSMS was the go to tool to understand what was happening and for debugging purposes. Anyway… That and $6 will get me that cup of coffee I want from Starbucks.
In our situation we have 2 paths to get to the Customer Name and CustID, which we want to print on the Job Traveler. Since we manufacturer parts specific to customers, we’ve added a ud field to the part table for custid (PartNum_CustId_c - I do not know why they didn’t use custnum - before my time). If the part is make to stock or just make to job, we want the part customer on the report.
If the job is a make to order, then we want the customer the order is for to be listed.
I understand the process of pulling from the db and creating the guid temp tables in the reporting db, but I have no idea how it would handle the multi path to the customer table. Would it create just one Customer_guid table or would it create a customer and a customer2 table based on path. At this time, based on your feedback, it appears to be just one table Customer_guid. If I had access to the schema it would answer this question. Then the next question is it adding both paths worth of information. Really wished I could dump the table somehow to see.
As of right now, MTS & MTJ’s are correctly being produced - as they were before I headed down this path. MTO’s are still not showing any customer information. If I could see the OrderHed_guid table I’d know if it was at least getting the ordernum.
Here is the defined relationship to the Customer table:
Here is the linked table to the Customer table:
And here are the fields from the linked table:
Here is the query in the RDL:
, T5.WhatIf
, T6.Name AS Customer, T6.CustID as CustomerId
, T7.OrderNum
, T8.CustNum
, T9.CustID as SOCustId
, T9.Name as SOCustName
FROM JobHead_" + Parameters!TableGuid.Value + " T1
LEFT OUTER JOIN JobAsmbl_" + Parameters!TableGuid.Value + " T2
ON T1.Company = T2.Company AND T1.JobNum = T2.JobNum
LEFT OUTER JOIN JobOper_" + Parameters!TableGuid.Value + " T3
ON T2.Company = T3.Company AND T2.JobNum = T3.JobNum AND T2.AssemblySeq = T3.AssemblySeq
LEFT OUTER JOIN JobOpDtl_" + Parameters!TableGuid.Value + " T4
ON T3.Company = T4.Company AND T3.JobNum = T4.JobNum AND T3.AssemblySeq = T4.AssemblySeq AND T3.OprSeq = T4.OprSeq
LEFT OUTER JOIN ResourceTimeUsed_" + Parameters!TableGuid.Value + " T5
ON T4.Company = T5.Company AND T4.JobNum = T5.JobNum AND T4.AssemblySeq = T5.AssemblySeq AND T4.OprSeq = T5.OprSeq AND T4.OpDtlSeq = T5.OpDtlSeq
LEFT OUTER JOIN Customer_" + Parameters!TableGuid.Value + " T6
ON T2.Company = T6.Company AND T2.PartNum_CustId_c = T6.CustID
LEFT OUTER JOIN JobProd_" + Parameters!TableGuid.Value + " T7
ON T1.Company = T7.Company AND T1.JobNum = T7.JobNum
LEFT OUTER JOIN OrderHed_" + Parameters!TableGuid.Value + " T8
ON T7.Company = T8.Company AND T7.OrderNum = T8.OrderNum
LEFT OUTER JOIN Customer_" + Parameters!TableGuid.Value + " T9
ON T8.Company = T9.Company AND T8.CustNum = T9.CustNum"