Friday, July 22, 2016

Looking up values in Validation Rules

The VLookup function provides the ability to lookup values from other objects.  Note that it ONLY works on Custom Objects.  The format is: VLookup(field_to_return, field_on_lookup_object, lookup_value).

So if you need need to lookup an item from a custom table with an Id of 00Xj000000NK03j, and return the name, the formula would look something like this:  


Tuesday, July 19, 2016

Viewing the ValidationExceptions Collection

Occassionally, .NET apps that are using EntityFramework will throw the following error

System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
The easiest way to see what these exceptions is to add the following to the Watch window:
((System.Data.Entity.Validation.DbEntityValidationException)$exception).EntityValidationErrors