Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2024-11-18 09:00 AM - edited 2024-11-18 09:28 AM
Saving a Global iView fails with the below warning message.
iView name is not unique
Even though, it is confirmed that no other existing Global iView has the same name.
This might occur because there is a Widget (used by a Next Gen Dashboard) with the same name as the iView. Widgets and iViews cannot have the same name.
Consider a different name for the Global iView. However, if that is not acceptable, check the steps below.
Rename the Widget from the Archer UI:
1. Locate the Widget with the same name and try renaming it.
2. Test saving the Global iView again with the intended name. If the error is still present, refer to the below method.
Use SQL script to delete the Widget from the Database:
Renaming or deleting an existing Widget via the Archer UI might not be a successful fix with most Widget types. In such cases, run the below/attached SQL script (delete_widget_conflicting_with_iview_name.sql) against the Instance Database to delete the Widget completely from Archer.
Note:
Ensure the below points before running the below/attached script:
Kindly note that necessary measures such as, but not limited to, taking a database backup and testing the script(s) in a non-prod environment first should be done before executing any SQL scripts and/or applying any changes in the Database.
DECLARE @iview_name NVARCHAR(MAX);
SET @iview_name = '<iview_name_here>'; -- Insert the iview name here which conflicts with same widget name
-- Temporary tables to store iview_id and dashboard_iview_id and link_id
DECLARE @iview_ids TABLE (iview_id INT);
DECLARE @dashboard_iview_ids TABLE (dashboard_iview_id INT);
DECLARE @link_ids TABLE (link_id INT);
INSERT INTO @iview_ids (iview_id)
SELECT DISTINCT iview_id
FROM tblIViewTranslation
WHERE iview_name = @iview_name;
INSERT INTO @dashboard_iview_ids (dashboard_iview_id)
SELECT DISTINCT dashboard_iview_id
FROM tblXDashboardIView
WHERE iview_id IN (SELECT iview_id FROM @iview_ids);
INSERT INTO @link_ids (link_id)
SELECT DISTINCT link_id
FROM tblIViewLink
WHERE iview_id IN (SELECT iview_id FROM @iview_ids);
-- Delete from tblXIViewReport
DELETE R
FROM tblXIViewReport R
JOIN @iview_ids I ON R.iview_id = I.iview_id;
-- Delete from tblIViewLinkTranslation
DELETE LT
FROM tblIViewLinkTranslation LT
JOIN @link_ids L ON LT.link_id = L.link_id;
-- Delete from tblIViewLink
DELETE L
FROM tblIViewLink L
JOIN @link_ids L2 ON L.link_id = L2.link_id;
-- Delete from tblIViewTranslation
DELETE T
FROM tblIViewTranslation T
JOIN @iview_ids I ON T.iview_id = I.iview_id;
-- Delete from tblXDashboardIViewTranslation
DELETE DT
FROM tblXDashboardIViewTranslation DT
JOIN @dashboard_iview_ids D ON DT.dashboard_iview_id = D.dashboard_iview_id;
-- Delete from tblXDashboardIView
DELETE D
FROM tblXDashboardIView D
JOIN @iview_ids I ON D.iview_id = I.iview_id;
-- Delete from tblIView
DELETE I
FROM tblIView I
JOIN @iview_ids II ON I.iview_id = II.iview_id;