What is the Update Script to Convert Advanced Browse Pages to Browse Pages – Upgrade from v5.x to v6

How Can We Help?

< Back

Answer

Advance Browse pages have been deprecated.

Use following SQL script to convert all Adv Browse Pages to Browse Pages:

Begin Transaction ConvertAdvanceBwPages

DECLARE @AdvBwPages TABLE

(

ControlID bigint

)

INSERT INTO @AdvBwPages

SELECT [ID]

FROM [fcEventControl]

where [Type] = 'Advanced Browse Page'

INSERT INTO [fcBrowsePage]

([Title]

,[Description]

,[Connection]

,[SQL]

,[OrderBy]

,[PageSize]

,[EventControlID])

SELECT   [Title]

,[Description]

,[ConnectionString]

,CASE WHEN len(LTRIM([WhereClause])) > 0

THEN [Query] + ' WHERE ' + [WhereClause]

ELSE [Query]

END

,[OrderBy]

,[PageSize]

,[EventControlID]

FROM [fcAdvancedBrowsePage]

WHERE [EventControlID] IN (SELECT [ControlID]

FROM @AdvBwPages)

 

INSERT INTO [dbo].[fcBrowseObject]

([BrowsePageID]

,[cIndex]

,[Name]

,[Description]

,[Source]

,[Target]

,[Filter])

SELECT [fcBrowsePage].[ID]

,[fcAdvancedBrowseObject].[cIndex]

,[fcAdvancedBrowseObject].[Name]

,[fcAdvancedBrowseObject].[Description]

,[fcAdvancedBrowseObject].[Source]

,[fcAdvancedBrowseObject].[Target]

,0

FROM [fcAdvancedBrowseObject]

INNER JOIN [fcAdvancedBrowsePage] ON [fcAdvancedBrowsePage].[ID] = [fcAdvancedBrowseObject].[AdvancedBrowsePageID]

INNER JOIN [fcBrowsePage] ON [fcBrowsePage].[EventControlID] = [fcAdvancedBrowsePage].[EventControlID]

UPDATE [fcEventControl]

SET [Type] = 'Browse Page'

WHERE [ID] IN (SELECT [ControlID]

FROM @AdvBwPages)

DELETE FROM [fcAdvancedBrowseObject]

WHERE [AdvancedBrowsePageID] IN (SELECT [ID]

FROM [fcAdvancedBrowsePage]

WHERE [EventControlID] IN (SELECT [ControlID]

FROM @AdvBwPages))

DELETE FROM [fcAdvancedBrowsePage]

WHERE [EventControlID] IN (SELECT [ControlID]

FROM @AdvBwPages)

Commit Transaction ConvertAdvanceBwPages
Comments are closed.

This is the legacy version of the XMPro Documentation site. For the latest XMPro documentation, please visit documentation.xmpro.com

X