# SCR 119161 WhseBinAttr Table Missing From BAQ Builder **Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5) **Created:** 2016-12-07 18:50 UTC **Views:** 1217 **Replies:** 2 **URL:** https://www.epiusers.help/t/scr-119161-whsebinattr-table-missing-from-baq-builder/36544 --- ## Post #1 by @Rick_Bird Has anyone else ran into this issue where the WhseBinAttr (Bin attributes) table is not available in the BAQ Builder nor query builders in BPM's? I did some research and found the following: whsebinattr records exists in: -Ice.TableAttribute -Ice.ColumnAttribute whsebinattr records do NOT exist in: -Ice.ZDataTable -Ice.ZDataField Based on the records in these tables it looks like the contents in ZDataTable & ZDataField matches the tables listed in the BAQ Builder. To fix this I think it would be a simple SQL data fix that would insert the missing records in each of these tables... I think this would be a pretty easy data fix for Epicor to provide. However when I asked for a data fix it was denied. We really need access to the Bin Attribute table so we can show the right data to the user in a dashboard and a search and we need an error message in a BPM based on the attributes a bin has, so I am testing creating the missing records in a test db first. --- ## Post #2 by @Rick_Bird Without Epicor being willing to provide a data fix for this I cobbled together the following SQL to insert the missing records into the ZDataTable & ZDataField tables so I can use the Warehouse Bin Attribute table in BAQ's & BPMs. Just in case someone else needs this the code is below, use at your own risk, test out fully on a Test environment first! ...Remember, I am not an SQL pro, this is truly cobbled together, mostly trial and error. --DO NOT JUST EXECUTE THE ENTIRE SQL STATEMENT, understand what this does first. --Check to see if the WhseBinAttr record already exists or not IF (select count(*) from Ice.ZDataTable where DataTableID = 'WhseBinattr') = 1 PRINT 'The WhseBinattr table record already exists in Ice.ZDataTable' Else BEGIN Print 'The WhseBinattr table record is missing from Ice.ZDataTable, inserting from Ice.TableAttribute' --IF no records are returned then run the following Insert Insert into Ice.ZDataTable (SystemCode, DataTableID, Description, SchemaName, DBTableName) select SchemaName, TableName, TableDesc, SchemaName, TableName From Ice.TableAttribute where TableName = 'whsebinattr' --Correct record with update update Ice.ZdataTable set SystemCode = 'ERP', SystemFlag = 1 where DataTableID = 'WhseBinattr' END; --Check to see if the WhseBinattr field records exist IF (select count(*) from Ice.ZDataField where DataTableID = 'WhseBinattr') > 5 PRINT 'The WhseBinattr field records already exists in Ice.ZDataField' Else --Insert records from Ice.ColumnAttribute table BEGIN Insert into Ice.ZDataField (SystemCode, DataTableID, FieldName, Seq, DBTableName, DBFieldname, DataType, Description, Included, SystemFlag) select 'ERP', TableName, ColumnName, ROW_Number() OVER(Order By Substring(Convert(nvarchar(36),SysRowID),5,1)), TableName, ColumnName, (case when ColumnName ='SysRevID' then 'timestamp' when ColumnName = 'SysRowID' then 'uniqueidentifier' when Format like '%x%' then 'nvarchar' else '?' end), ColumnDesc, 1, 1 From Ice.ColumnAttribute where TableName = 'whsebinattr' --Set Like fields UPDATE Ice.ZdataField SET LikeDataFieldSystemCode = 'ERP', Required = 1, LikeDataFieldTableID = CASE FieldName WHEN 'Company' THEN 'Company' WHEN 'WarehouseCode' THEN 'Warehse' WHEN 'BinNum' THEN 'WhseBin' ELSE '' END, LikeDataFieldName = Case FieldName WHEN 'Company' THEN 'Company' WHEN 'WarehouseCode' THEN 'WarehouseCode' WHEN 'BinNum' THEN 'BinNum' ELSE '' END Where Ice.ZdataField.DataTableID = 'whsebinattr' and FieldName IN ('Company', 'WarehouseCode', 'BinNum') --Show Results select * from Ice.ZDataField where DataTableID = 'WhseBinattr' order by Seq END; --- ## Post #3 by @AndrewM I know this is a really old topic now and it appears that the issue is fixed in later releases, but it seems that there are many things related to whsebinattr that are missing. Perhaps this is why it seems like a wasted feature. We're trying to set attributes against bins, which would qualify/disqualify parts so the Bin Attributes seems like an obvious thing to set. The problem comes when trying to programmatically do anything with these attributes since there seems to be no service associated with them. I'm trying to utilise the Epicor Functions so that I can just set attributes by range. I can do this through a BAQ BPM with the following: Erp.Tables.whsebinattr whsebinattr=new Erp.Tables.whsebinattr(); Db.whsebinattr.Insert(whsebinattr); whsebinattr.Company = WhseBin_Company; whsebinattr.WarehouseCode = WhseBin_WarehouseCode; whsebinattr.BinNum = WhseBin_BinNum; whsebinattr.AttrCode = AttrBin_AttrCode; Db.Validate(whsebinattr); But this won't work in Epicor Functions since there is no Db context, not able to reference Erp.Tables.whsebinattr, etc. So I tried going down the service route, however, there seem to be none. I'd be interested to hear from others if there are any ideas of how to make this work. Also, is anyone else using the bin attributes? If not, perhaps I should just implement my own using a UD table and be done with it in case it's likely to be depreciated in the future... what's the feeling on this? --- **Canonical:** https://www.epiusers.help/t/scr-119161-whsebinattr-table-missing-from-baq-builder/36544 **Original content:** https://www.epiusers.help/t/scr-119161-whsebinattr-table-missing-from-baq-builder/36544