• Saurabh_Gupta
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

I have a custom object , which includes three custom fields (Start date, End Date and Business Unit(Type: Picklist).

The three custom fields should be unique for a record, so the combination of these fields makes my record unique.

 

 

 

Example: start date: 05/20/2011, End Date: 05/27/2011, Business Type: Devices

                  Start date: 05/20/2011, End date:05/27/2011, Business Type: Drugs

 

Also, we must make sure that for new record the start and end dates do not fall within the above mentioned dates.

So the next acceptable record is:

 

Start date: 05/28/2011, end date: 05/31/2011,business type:Devices.

 

Note: I have a validation rule that checks that end date is always after start date.

 

I am having a road block to get this logic right in my trigger . Any help/pseudo code on this is highly appreciated.

 

Thanks,

Sales4ce