BAQ Format

If your job numbers are continuously incremented numbers with no gaps, you could probably define a column in your BAQ with the calculation convert(int,JobMtl.JobNum) % 2 as a field called ToggleRow. However, if you have gaps in your job numbers or have any job numbers that have any letters in them (very common), I might suggest using an external BAQ using a view that looks something like this:
SELECT m.Company, m.JobNum, m.MtlSeq, j.RowNum % 2 As ToggleRow FROM Erp.JobMtl m INNER JOIN (SELECT Company, JobNum, ROW_Number() OVER(PARTITION BY Company ORDER BY Company, JobNum) As RowNum FROM Erp.JobHead) j ON m.Company = j.Company AND m.JobNum = j.JobNum

This gives you a data column that basically alternates between 0 and 1 as the job number changes.

You can then add a row rule to the grid that sets the color for all fields where the calculated field is 1. The 0 would remain the default background color.

(This does assume for simplicity that all jobs have at least one material, though you could alter the query as a tradeoff for performance to use the distinct jobs in the job material table in your subquery.)

EDIT: If this is possible through the application layer, I’m going to hazard a guess based on my experience with these grids that the performance will be better performing this in the data layer albeit perhaps not with my exact implementation.

1 Like