IEstimate.DisplayAnomalies Method

Displays a window with a list of anomalies added by a request or a macro. The window allows to click on an anomaly which will navigate directly to the affected line in the estimate.
Sub DisplayAnomalies( _ 
ByVal anomalies As IEnumerable(Of Anomaly) _ 
)
This language is not supported or no code example is available.
void DisplayAnomalies( 
IEnumerable<Anomaly> anomalies 
)
This language is not supported or no code example is available.

Parameters

anomalies
IEnumerable<Anomaly>

The list of anomalies to be displayed.

Exception type Condition

ArgumentNullException

The anomalies is null reference (Nothing in Visual Basic).

Remarks
 
If the anomalies is empty, then no window will be displayed.
Example
 

The following example macro creates two anomalies and calls a request that also creates some anomalies. The anomalies from the request are joined with the anomalies from the macro. At the end, all anomalies are displayed in the QDV standard "Anomalies" window

' Define a list of all cumulated anomalies created during execution of this macro.                            
 Dim allAnomalies As New List(Of Anomaly)()                                                                     
                                                                                                                
 ' Get a random task and create an anomaly for its line 1                                                       
 Dim taskWithAnomaly As ITask = Es.CurrentVersion.Wbs.Root.SubTasks(0).SubTasks(0)                              
 Dim MyAnomaly As New Anomaly(taskWithAnomaly.HexID, 1, "My anomaly 1")                                         
 allAnomalies.Add(MyAnomaly)                                                                                    
                                                                                                                
 ' Call a request that fills some anomalies, they will be accessible in Es.Anomalies.                           
 ' Suppress displaying anomalies automatically in the request - set the last parameter of RunQdvRequest to False.
 Dim requestError As New MacroExecutionError()                                                                  
 Es.RunQdvRequest("my_request", 1, 1, 1, requestError, False)                                                   
                                                                                                                
 ' Read the anomalies from the last request (stored in Es.Anomalies) and append them to our cumulated anomalies.
 allAnomalies.AddRange(Es.Anomalies)                                                                            
                                                                                                                
 ' Add one more anomaly, for the same line as the first anomaly                                                 
 myAnomaly = New Anomaly(taskWithAnomaly.HexID, 1, "My anomaly 2")                                              
 allAnomalies.Add(MyAnomaly)                                                                                    
                                                                                                                
 ' Now display all anomalies                                                                                    
 Es.DisplayAnomalies(allAnomalies)					
This language is not supported or no code example is available.

Version
 
Available since QDV 7.19.753.

.NET Framework

Supported in: 4.8, 4.7, 4.6, 4.5.2

In this article

Definition