Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS 500 Customer
DGill
Posts: 218
Registered: 11-06-2008
0

Re: Changing the color of the Desktop in different databases

The stuff function is probably returning null for the provided args.  You will have to do some digging into the different elements to figure out which part needs to be tweaked for your install.  Possibly on the release you are on, one of the 2 elements used in the update do not exist in that column value.  The query below will help you in figuring it out.  Run it for one of the users it is returning a null for and then look at the returned data and figure out at which character the node starts and how long it is and match that up against the query results.

 

SELECT TOP 1 CAST(DesktopSettings AS VARCHAR(MAX)) FROM tsmUserDesktop WHERE ActualUserID = [TODO Add UserID of Someone With Null Value] SELECT CHARINDEX ('<StartPage', DesktopSettings) AS 'Starting Character of Stuff', CHARINDEX ('<UndockedBusinessDesktop>', DesktopSettings) - CHARINDEX ('<StartPage', DesktopSettings) AS 'No of Characters to be Stuffed' FROM tsmUserDesktop

 

 

where clause

Sage MAS 500 Customer
oyama
Posts: 236
Registered: 05-19-2009
0

Re: Changing the color of the Desktop in different databases

Ok, it is working now. That is just beautiful. For those who has to switch back and forth between the 2 test and production environment this is a easy and quick way to determinate what data is being manuipulated.

Thank you for the script! :smileyhappy:

Sage MAS 500 Customer
oyama
Posts: 236
Registered: 05-19-2009
0

Re: Changing the color of the Desktop in different databases

Just out of curiosity (and laziness), do you have a script that works on 7.3? :smileywink:

Sage MAS 500 Customer
DGill
Posts: 218
Registered: 11-06-2008
0

Re: Changing the color of the Desktop in different databases

Not yet, on my TODO list.  I will post it back here when I do have it.  Possibly someone else may have one?

Sage MAS 500 Customer
oyama
Posts: 236
Registered: 05-19-2009

My laziness is gone. Here is a proposed solution for 7.3!

The default background web page is "Welcome.htm" for MAS 500 7.3. The user desktop settings appears to be quite different from 7.2 and I could  not find the web page location easily in the database in order to change it.

 

Well, after same research I found that there are  three columns that has a value of  "Welcome.htm" in our entire database as follows.

 

 

TableName                           ColumnName

tsmPrimaryMenuItem         GroupContentPathdbo

tsmPrimaryMenuItem         TaskValuedbo

tsmUserMenuItem              TaskValue

 

It turns out once that the tsmPrimaryMenuItem.GroupContentPath field is what I had to change, but only for those records where the Caption field is equal 'Home'. 

 

This is my code to do that:

 

Warning!

 

Do not try this at home or on your production server! Use the provided script at your own risk.

 

 

----------------------------------------------------------------------

USE [mas500_app]

GO

 

BEGIN TRAN testupdate

IF @@SERVERNAME = 'prod server name'  --TO DO fill in your PRODUCTION SERVER name 

BEGIN

PRINT '*************************************************'

PRINT 'WHAT ARE YOU CRAZY? DON"T RUN THIS IN PRODUCTION!'

PRINT '*************************************************'

END

ELSE

BEGIN

UPDATE tsmPrimaryMenuItem

SET GroupContentPath =

CASE 

WHEN @@SERVERNAME = 'TEST'  THEN 'file:\\blablabla\Server_D2ITBC024.html'

WHEN @@SERVERNAME = 'D1ITSV019'   THEN 'file:\\blablabla\Server_D1ITSV019.html'

WHEN @@SERVERNAME = 'D1ITSV025'   THEN 'file:\\blablabla\Server_D1ITSV025.html'

ELSE GroupContentPath

END

FROM tsmPrimaryMenuItem

WHERE Caption = 'Home' and GroupContentPath LIKE '%.htm%'

END

 

ROLLBACK TRAN testupdate

--COMMIT TRAN testupdate

----------------------------------------------------------------------

 

Since I have a limited knowledge about MAS500 7.3 this could be a wrong way to do it. (But it worked for me) If you have anything to add to make it better or understand how the desktop configuration works, please do not hesitate and post up.


Thank you!