VERIFIED SOLUTION i
X

Resolve Confirm error - 'Cannot proceed, the Inspection Group already has this site, and the same site cannot appear twice in the same Group' error when creating a new inspection

Issue

 'Cannot proceed, the Inspection Group already has this site, and the same site cannot appear twice in the same Group' error when creating a new inspection.

Cause

This has been identified as a software defect in V14.

Whenever we add or edit an Inspection. It validates the GroupSite Unique combinations. 
If it is not unique it then raises this error. It means an inspection group should have unique site id and inspresultnum 

To identify if this is the cause, run the following SQL :

SELECT Count * 
FROM actual_inspection 
WHERE actual_inspection.work_header_no = ***** AND actual_inspection.site_number = ***** AND actual_inspection.insp_result_num = **** AND actual_inspection.insp_number <> :lc_InspNumber ; 

If it returns the count > 0 then raises the error. It seems this is a valid message which comes up while saving or updating an Inspection. 

Resolution

UPDATED: August 23, 2017


Run the first select SQL below to identify if this the issue:

SELECT Count * 
FROM actual_inspection 
WHERE actual_inspection.work_header_no = ***** AND actual_inspection.site_number = ***** AND actual_inspection.insp_result_num = **** AND actual_inspection.insp_number <> :lc_InspNumber ; 

If count is > 0 , take a backup of the database, then run

UPDATE sw_header 
   SET insp_result_num = 
       ( SELECT Max(ai1.insp_result_num) 
           FROM actual_inspection ai1 
          WHERE ai1.work_header_no = sw_header.work_header_no ) 
 WHERE EXISTS 
       ( SELECT * 
           FROM actual_inspection ai2 
          WHERE ai2.work_header_no = sw_header.work_header_no ) 
   AND insp_result_num <> 
       ( SELECT Max(ai3.insp_result_num) 
           FROM actual_inspection ai3 
          WHERE ai3.work_header_no = sw_header.work_header_no ) ; 

UPDATE sw_site 
   SET insp_number = 
       ( SELECT Max( ai1.insp_number) 
           FROM actual_inspection ai1 
          WHERE ai1.work_header_no = sw_site.work_header_no 
            AND ai1.site_number = sw_site.site_number ) 
 WHERE insp_number <> 
       ( SELECT Max( ai2.insp_number) 
           FROM actual_inspection ai2 
          WHERE ai2.work_header_no = sw_site.work_header_no 
            AND ai2.site_number = sw_site.site_number ) ; 

This will allow the user to create the new inspection.

 

Environment Details

Product Feature: Street Works

 

Downloads

  • No Downloads