The IntercompanyID property contains the internal ID of the company that the user is currently logged into in Microsoft Dynamics GP.
UserInfo.IntercompanyID
• UserInfo – A UserInfo object.
The value of the IntercompanyID property is the same as the name of the SQL database used for that company.