BAQ Needs Licensed Fields To Return Results?

I have this Parts List BAQ that returns parts and materials. The BAQ requires relations between PartRev and PartMtl using fields we dont have. If I leave those relations in there, The BAQ runs with a warning(about the secured licensed column…), and returns no records. If I remove the AltMethod, and ProcessMfgID from the table relations link between PartRev and PartMtl then I get records, but also a SQL error. I think this SQL error may be causing issues with deploying the report.

If the BAQ dictionary suggests to use those fields, and we dont have the module license for them, how can we still pull data without getting a SQL error?

/*  
 * Disclaimer!!! 
 * This is not a real query being executed, but a simplified version for general vision. 
 * Executing it with any other tool may produce a different result. 
 */

select  
	[PartMtl].[FindNum] as [PartMtl_FindNum], 
	[PartRev].[PartNum] as [PartRev_PartNum], 
	[Part].[PartDescription] as [Part_PartDescription], 
	[PartRev].[RevisionNum] as [PartRev_RevisionNum], 
	[PartMtl].[MtlPartNum] as [PartMtl_MtlPartNum], 
	[Part1].[PartDescription] as [Part1_PartDescription], 
	[PartMtl].[QtyPer] as [PartMtl_QtyPer], 
	[PartMtl].[UOMCode] as [PartMtl_UOMCode], 
	[PartRev].[RevShortDesc] as [PartRev_RevShortDesc], 
	(PartRev.PartNum + PartRev.RevisionNum) as [Calculated_Part_Version], 
	(case 
    when PartMtl.FindNum is null then 0
    else convert(int, PartMtl.FindNum)
end) as [Calculated_FindNum_Int] 

from Erp.Part as [Part]
inner join Erp.PartRev as [PartRev] on 
	  Part.Company = PartRev.Company
	and  Part.PartNum = PartRev.PartNum
inner join Erp.PartMtl as [PartMtl] on 
	  PartMtl.Company = PartRev.Company
	and  PartMtl.PartNum = PartRev.PartNum
	and  PartMtl.RevisionNum = PartRev.RevisionNum
inner join Erp.Part as [Part1] on 
	  PartMtl.Company = Part1.Company
	and  PartMtl.MtlPartNum = Part1.PartNum

Remove those fields from the join. This is a known bug for many years.

3 Likes

And ignore the resulting SQL error?

What error? If its just the index whatever warning then yes ignore it.

I had to put in a ticket for this same issue with the OrderHed table…they secured the friggin’ EDIOrder field. They removed the restriction.

1 Like

Severity: Error, Text: Bad SQL statement. Review the server event logs for details. Correlation ID: yaddayadda…

Normally this results in the BAQ not returning all results, but I am getting some records returned here along with this SQL error.

Removing the UNlicensed fields from your join does not cause that error.

KB0131700

1 Like

1 Like

Adding and removing those field joins directly cause the error in my case. If I add them I get no records, if I remove them I get SQL error with records.

Based on your statement, I removed one of my calculated fields I had suspicions about. That seems to have also removed the SQL error! Thank you!

2 Likes