Export (0) Print
Expand All

FormErrorCollection.Delete method (String)

Deletes all FormError objects of the specified name from the FormErrorCollection object associated with the current form.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

public abstract void Delete(
	string name
)

Parameters

name
Type: System.String

The name of the FormError to delete.

ExceptionCondition
ArgumentException

The error is not of type FormErrorType.UserDefined.

ArgumentException

The error is not in the collection.

ArgumentNullException

The parameter passed to this method is a null reference (Nothing in Visual Basic).

ArgumentException

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

All errors of the specified name will be deleted from the collection (errors associated with different context nodes in the form can have the same name). Only errors of type ErrorType.UserDefined can be deleted from the collection. If the specified error is not user-defined, or is not in the collection, an exception is thrown.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed from code running in forms opened in Microsoft InfoPath Filler or in a Web browser.

In the following example, the Delete(name) method is used to delete the error name Field1Error from the FormErrorCollection object associated with the current form.

this.Errors.Delete("Field1Error");

Community Additions

Show:
© 2014 Microsoft