• Niamh L
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
Hi, 

I am creating a Visualforce page and want to display the pet breed available from the pet custom object. I have a field on the case object called Pet Name (Pet__c) which is a lookup field to the pet object to select the pet.
But on the VF page I want to display the breed and age of the pet too, but i get the error Unknown property 'String.Pet_Breed__c'
See code for page below:

  <tr>
                <td valign="top" style="padding:3px;"></td>
                <td height="30" width="300" valign="top" style="padding:3px;">Breed of Pet:</td>
                <td width="300" valign="top" style="padding:3px;">{!Case.Pet__c.Pet_Breed__c}</td>
  </tr>

Any help appreciated.
 
Hi All, 

I am trying to prevent people double booking a piece of equipment out. The user uses the custom object Booking Request to book out equipment for certain dates. 
For example Mike books equipment1 from the 22/06/2016 until 24/06/2016, then someone else wants to book the same piece of equipment from the 23/06/2016 until 25/06/2016 but should not be allowed as it is already booked.

I have created the following trigger which is working if someone enters the same start date, but how do i stop the record saving if they book in between the start and finish date? Any help greatly appreciated.

trigger DuplicateBookingTrigger on Booking_Request__c (before insert, before update) {
  for (Booking_Request__c br:Trigger.new)
  {
      List<Booking_Request__c> b=[select ID from Booking_Request__c where Equipment_Code__c=:br.Equipment_Code__c and Start_Date__c=: br.Start_Date__c and Finish_Date__c=: br.Finish_Date__c];
      if(b.size()>0)
      {
          br.adderror('The equipment selected is already booked for this date');
      }
   }
Hi, 

I am creating a Visualforce page and want to display the pet breed available from the pet custom object. I have a field on the case object called Pet Name (Pet__c) which is a lookup field to the pet object to select the pet.
But on the VF page I want to display the breed and age of the pet too, but i get the error Unknown property 'String.Pet_Breed__c'
See code for page below:

  <tr>
                <td valign="top" style="padding:3px;"></td>
                <td height="30" width="300" valign="top" style="padding:3px;">Breed of Pet:</td>
                <td width="300" valign="top" style="padding:3px;">{!Case.Pet__c.Pet_Breed__c}</td>
  </tr>

Any help appreciated.
 
Hi All, 

I am trying to prevent people double booking a piece of equipment out. The user uses the custom object Booking Request to book out equipment for certain dates. 
For example Mike books equipment1 from the 22/06/2016 until 24/06/2016, then someone else wants to book the same piece of equipment from the 23/06/2016 until 25/06/2016 but should not be allowed as it is already booked.

I have created the following trigger which is working if someone enters the same start date, but how do i stop the record saving if they book in between the start and finish date? Any help greatly appreciated.

trigger DuplicateBookingTrigger on Booking_Request__c (before insert, before update) {
  for (Booking_Request__c br:Trigger.new)
  {
      List<Booking_Request__c> b=[select ID from Booking_Request__c where Equipment_Code__c=:br.Equipment_Code__c and Start_Date__c=: br.Start_Date__c and Finish_Date__c=: br.Finish_Date__c];
      if(b.size()>0)
      {
          br.adderror('The equipment selected is already booked for this date');
      }
   }