Copying Quick Links from one Microsoft Dynamics GP user to another

Just recently, I ran across a question on the Microsoft Dynamics GP Community forum asking for a way to copy Quick Links from one user to another.

Users can tailor their Quick Links by clicking on the Customize this page... link on the upper right corner of the Microsoft Dynamics GP homepage.

Quick Links setup

These settings are stored in the syHomePageQuickLinks table (dbo.SY08140) at the system database level.

However, if you want to deploy a set of Quick Links based on a template user ID, it becomes quite the challenge to have to assist each individual user in doing so. The following SQL script allows you to copy all entries from a Source_UserId to a Destination_UserId account in Microsoft Dynamics GP:

-- Created by Mariano Gomez, MVP
USE DYNAMICS
GO

DELETE FROM dbo.SY08140 WHERE USERID = 'Destination_UserId';

INSERT INTO dbo.SY08140 (USERID
      ,SEQNUMBR
      ,TYPEID
      ,CmdID
      ,CmdFormID
      ,CmdDictID
      ,DSPLNAME
      ,ScbTargetStringOne
      ,ScbTargetStringTwo
      ,ScbTargetStringThree
      ,ScbTargetLongOne
      ,ScbTargetLongTwo
      ,ScbTargetLongThree
      ,ScbTargetLongFour
      ,ScbTargetLongFive)
SELECT 'Destination_UserId'
      ,SEQNUMBR
      ,TYPEID
      ,CmdID
      ,CmdFormID
      ,CmdDictID
      ,DSPLNAME
      ,ScbTargetStringOne
      ,ScbTargetStringTwo
      ,ScbTargetStringThree
      ,ScbTargetLongOne
      ,ScbTargetLongTwo
      ,ScbTargetLongThree
      ,ScbTargetLongFour
      ,ScbTargetLongFive
  FROM dbo.SY08140
  WHERE USERID = 'Source_UserId';
GO

If you are needing to transfer just one Quick Link out of many from one user to another, that becomes a bit trickier because you will need to take into account the sequence number at the destination. It would be something like this:

-- Created by Mariano Gomez, MVP
INSERT INTO dbo.SY08140 (USERID
      ,SEQNUMBR
      ,TYPEID
      ,CmdID
      ,CmdFormID
      ,CmdDictID
      ,DSPLNAME
      ,ScbTargetStringOne
      ,ScbTargetStringTwo
      ,ScbTargetStringThree
      ,ScbTargetLongOne
      ,ScbTargetLongTwo
      ,ScbTargetLongThree
      ,ScbTargetLongFour
      ,ScbTargetLongFive)
SELECT 'Destination_UserId'
      ,(SELECT MAX(SEQNUMBR) + 1 FROM SY08140 WHERE USERID = 'Destination_UserId')
      ,TYPEID
      ,CmdID
      ,CmdFormID
      ,CmdDictID
      ,DSPLNAME
      ,ScbTargetStringOne
      ,ScbTargetStringTwo
      ,ScbTargetStringThree
      ,ScbTargetLongOne
      ,ScbTargetLongTwo
      ,ScbTargetLongThree
      ,ScbTargetLongFour
      ,ScbTargetLongFive
  FROM dbo.SY08140
  WHERE USERID = 'Source_UserId' and SEQNUMBR = 8;
GO


In the above example, I am copying just the entry corresponding to Sequence Number 8 from the source user ID to the destination user ID. You also don't want to run a delete for all the destination user entries as this would, well, remove all Quick Links.

Hope you find this script useful.

Until next post!

MG.-
Mariano Gomez, MVP

Comments

Steve Erbach said…
Very nice to find this, Mariano, just when I needed it! Thank you.

Steve Erbach
Green Bay, WI

Popular posts from this blog

Power Apps - Application Monitoring with Azure Application Insights

DBMS: 12 Microsoft Dynamics GP: 0 error when updating to Microsoft Dynamics GP 2013 R2

eConnect Integration Service for Microsoft Dynamics GP 2010