SQL query - GLBook unknown Company record

>>delete company
Also if you can access EpicWeb....
There are a few answerbooks on managing companies might help... 13233MPS, 17059MPS
Just be sure to make backups and verify the changes in a test environment

When we run the following SQL query against the database, we are seeing an unknown Company ‘epic04’ in the GLBook table that does not exist in the company maintenance set up.  Are there instances when a SQL query brings back an unknown company or a record in a table but a BAQ does not?

 

SELECT * FROM dbo.GLBook

>>Are there instances when a SQL query brings back an unknown company or a record
>>in a table but a BAQ does not?
Yes, some filtering can occur behind the scenes with BAQs
I'm not sure about the specifics of the GLBook but I have seen something similar to what you describe with some other tables.
I had an issue with Customer's and ShipTo's once. Discovered the BAQ would not return all the records - it's been a while but I'm pretty sure it was related to the company field. I know I finally used SELECT statements to get the info I needed to find/clear my errors.

Also, wasn't epic04 the company for one of the training db's?
In my case I cleared the errors thru the normal Epicor client.
Now that I think about it, had to do with Territories too.
Wasn't possible to show the records in BAQ lists but, each could be opened and edited individually.

epic04 sounds like you might have residue from a test company.
Probably isn't hurting anything?
 
>> epic04 company is coming from one of the training db’s
>> but not sure how it got into our Production database.
I'm guessing the application isn't having any problem?


As for select statements, except for a few exceptions, I specify company(s).
And I always include the company field in any joins
.

Are you licensed for multi-company?
Is you system live, noticed any problems related to company.

I saw another site with some residue in their tables... but I don't remember anything showing up in the clients.
It crept in when they had started configuring with multiple companies.. before going live.
They finally decided to go with one company and multiple plants instead.
Since going live, the application/security seems to have kept everything straight for their clients.
But.. occasionally some odd results in queries when the company selection is left "open".
>> How did you clear the
errors through the Epicor client on other tables such as Territories?
The things I did to fix won't apply for you.


>>The
epic04 Company is coming up in multiple tables such as SalesTer, FiscalCal, and GLBook. 
>>It is now impacting our AFR replication that it
is finding an invalid company using epic04.
If you haven't already called Epicor support, maybe try them now?

I'm not sure if you'll be able to delete the company, and even if you do, I'm thinking it probably won't delete company references in every table in the database. Sometimes they will provide cleanup scripts.

Or maybe they can help with  AFR too?
I've not used it but I'm thinking you could just add company filters?