RuleIsReferencedAttribute.FoundObjectMessageFormat Property
Gets or sets the format for specifying information on the found objects that reference the target object in the validation error message.
Namespace: DevExpress.Persistent.Validation
Assembly: DevExpress.Persistent.Base.v24.1.dll
NuGet Package: DevExpress.Persistent.Base
Declaration
Property Value
Type | Description |
---|---|
String | A sting value that can include one variable. This variable will be set to the key property value of the found object. |
Remarks
When you define an inverted RuleIsReferenced rule, it is broken when there are objects that reference the validated object. In this instance, a list of the found objects is written in the Validation Error window for the broken rule. You can format this list. To do this, use the RuleIsReferenced attribute’s FoundObjectMessageFormat parameter. The passed value will be set for the FoundObjectMessageFormat property of the Application Model’s Validation | Rules | Rule node. So, you can modify the value directly in the Model Editor.
By default, this property is set to “{0}”, which returns a list of found objects separated by the symbol that is specified by RuleIsReferencedAttribute.FoundObjectMessagesSeparator.
When using the RuleIsReferencedAttribute, the value for the FoundObjectMessageFormat property is passed as a named parameter. This means that you do not have to specify it. However, when specifying, use the following format: FoundObjectMessageFormat = “{0}” (FoundObjectMessageFormat := “{0}”, in Visual Basic).
If you set an empty string for FoundObjectMessageFormat, only text specified by MessageTemplateMustBeReferenced will be displayed in the validation window. Neither the text specified by ObjectExistsMessageTemplate nor a list of the found objects will be displayed.
Note
The list of the found objects is written in the Validation Error window, if you do not specify CustomMessageTemplate in code or the Model Editor.