another blog

Icon

About Microsoft Dynamics GP :-)

How to find, due to which Dynamics GP User sql stored procedure is calling?

Often we need to pass user id and intercompany id to sql stored procedure to do some data selection from custom tables or to maintain the log regarding user activity. This happens with us with one custom window of Dynamics GP, in the beginning our stored procedure didn’t need user id and intercompany id parameters and was working fine but with the client requirement changes at some point we needed to pass these two parameters, adding parameters means creating chunk and deployment to all machines, which was not possible as users were connected and updated was necessary as it was hindering there routine work.

We can get intercompany id easily by using   select dB_name() but we also needed to find the Dynamics GP user who is calling the stored procedure. To find that user we use this function inside our stored procedure and in this way  avoid updating chunk.

SUSER_SNAME()

This will returned the login dynamics gp user id when stored procedure will be called from GP.

Advertisements

Filed under: Dexterity Development, SQL,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: