function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
seb_mseb_m 

Validation of a custom object

Hello,

I am a new to force.com and I face a problem.

I have created 1 custom object Reservation with fields field1 and field2.

I want to add a validation rule that will check (at new object creation time) that another Reservation object does not already exist reservation with fields1that has the same vale as the object being created.

 

I have look at all the formula possibility and I don't see how to make a "find"  request on the existing objec.

 

Any idea

 

Thanks in advance for your help

Gregory512Gregory512

There are instructions on how to prevent duplicate records from being created based on one or more fields in the force.com cookbook.  You can download it here for free:

 

http://www.developerforce.com/events/forcedotcomcookbook/registration.php

 

Pg. 161

seb_mseb_m

Well, in fact i want something more sophisticated than preventing duplicate record.

 

it is something like this :

 

NewObject can be save is :

  number of record where (

field1>NewObject.field1 && field1<NewObject.field2 && field2<NewObject.field2 && field2>NewObject.field1) == 0