Monday, July 20, 2009

How to dynamically retrieve a company's name in Dynamics GP

So I had to build reports for a company and then make it generic so we could resell it to anybody. Well a big problem we had was how to get the company's name on the report without asking them for it. Well here's the trick:

WHERE Dynamics..Sy01500.INTERID = (SELECT db_name())

This works because Dynamics stores the company's database name, which you can reference to get to the company's formal name.

No comments:

Post a Comment