How to Locate Unused Screens and Views from an Application

 

ResourceCenter page: http://appstudio.verivo.com/display/coredoc/Screens+and+Views

 

Below is a script that can be run through SQL to locate all unused screens and views in an application. This can help when you have large apps you need to clean up. 

USE **YOURAPPDATABASE**

DECLARE @AppID int
SET @AppID = **YOURAPPID**


-- Find views that are not on a screen
SELECT V.ViewID, V.DisplayName FROM
tmpcfg_View V
LEFT JOIN tmpcfg_ScreenView SV ON SV.ViewID = V.ViewID
WHERE
V.AppID = @AppID
AND SV.ScreenViewID IS NULL


-- Find screens that are not used.
-- views may be used by default if they are the first view.
-- The startup screen should be excluded.
SELECT S.ScreenID, S.ScreenName, S.MenuAlias, UG.DisplayName AS Workflow, C.ControlID, GMI.GraphicalMenuItemID, MI.MenuItemID,PMI.PIMMenuItemID, P.PushID, AUTH.ScreenID, AV.ViewID, VIG.ViewInstructionGroupID

FROM
tmpcfg_Screen S
LEFT JOIN tmpcfg_Control C ON C.LaunchScreenID = S.ScreenID
LEFT JOIN tmpcfg_GraphicalMenuItem GMI ON GMI.TargetScreenID = S.ScreenID
LEFT JOIN tmpcfg_MenuItem MI ON MI.TargetScreenID = S.ScreenID
LEFT JOIN tmpcfg_PIMMenuItem PMI ON PMI.TargetScreenID = S.ScreenID
LEFT JOIN tmpcfg_PushConfig P ON P.SubscriptionScreenID = S.ScreenID OR P.PollScreenID = S.ScreenID
LEFT JOIN tmpcfg_Screen AUTH ON AUTH.AuthenticationScreenID = S.ScreenID
LEFT JOIN tmpcfg_View AV ON AV.AlternateScreenID = S.ScreenID
LEFT JOIN tmpcfg_ViewInstructionGroup VIG ON VIG.TargetScreenID = S.ScreenID
LEFT JOIN tmpcfg_UserGroup UG on UG.UserGroupID = S.UserGroupID
WHERE
S.AppID = @AppID
AND C.ControlID IS NULL
AND GMI.GraphicalMenuItemID IS NULL
AND MI.MenuItemID IS NULL
AND PMI.PIMMenuItemID IS NULL
AND P.PushID IS NULL
AND AUTH.ScreenID IS NULL
AND AV.ViewID IS NULL
AND VIG.ViewInstructionGroupID IS NULL
AND S.IsStartupScreen <> 1

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk