• tunedog
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 10
    Replies

I am a little stuck with a page I am trying to create.

 

Basically, I am trying to create a collection of apartment records related to a building parent record. I then want to split this list into the different building levels/floors. Using this data, I want to construct a table on my VF page such that each row represents a floor and each cell represents an individual apartment. 

 

Any suggestions on where to start with this would be greatly appreciated.

 

Thanks in advance.

Can anyone give me some pointers on how to write a test method for this redirect extension?

Thanks in advance for any help!


 

public with sharing class aquavistaRedirect {

	PageReference rd= new PageReference('http://www.prmaustralia.com.au/MAB/Aquavista_Thankyou.html');
	
	    ApexPages.StandardController controller;
    public aquavistaRedirect(ApexPages.StandardController con){
        controller = con;
     }            
 
    public PageReference save() {
        controller.save();
        return rd;
    }

}

 

The trigger below runs through a set of logic looking for matching Contacts/Person Accounts based on email address and creating Accounts/Contacts and Person Accounts where they don't already exist.

 

Everything is working fine except for the bit that is highlighted.

It is supposed to create a new Person Account and then update a lookup with the new Person Account ID.

The Person Account record is being created just fine, but the lookup is not being populated like it is with the rest of the trigger.

If a second record is created with a matching email address, the lookup is populated on the second record as it should.

 

Any idea what I am doing wrong??

 

Thanks is advance for any help.

 

 

trigger enquiryTrigger on Enquiry__c (before insert) {

// Get the email address from the enquiry record
   List<Enquiry__c> enqEmail = [select email__c from Enquiry__c where ID in :Trigger.new];
 
   for(Enquiry__c e: Trigger.new){

// Get the contact with matching email address   	
      List<Contact> conID = [select Name from Contact where Email = :e.email__c limit 1];

// If matching contact is found update Enquiry record      
      if (conID.size() > 0) {
      	e.Matching_Contact__c = conID[0].Id;

      } 

//If no matching contact is found and enquiry DOES NOT contain a Company, create a Person Account

else if (e.company__c == null) {

		Account pa = new Account (RecordTypeId = '01220000000DpJM', LastName = e.Name, PersonEmail = e.Email__c, Phone = e.Phone__c);
		insert pa;
		
		// Update Enquiry with new Person Account      		
		e.Matching_Contact__c = pa.PersonContactId;
      	
       } else {

		// If Enquiry does contain a Company check for matching Account record       	
		       	List<Account> accName = [select Id from Account where Name = :e.Company__c limit 1];
		      
		      	if (accName.size() > 0) {
		
				// If matching Account record is found, create a contact on the existing Account
				      		Contact c = new Contact (LastName = e.Name, Phone = e.Phone__c, Email = e.email__c, AccountId = accName[0].Id);
					       	insert c;
				
				// Update Enquiry with new Contact	       	
					       	e.Matching_Contact__c = c.Id;
	       	
		      	} else {
		      		
				// If no matching Account is found, create an Account        		
					       	Account a = new Account (Name=e.Company__c);
					       	insert a;
					       	
				// Create a related Contact	       	
					       	Contact c = new Contact (LastName = e.Name, Phone = e.Phone__c, Email = e.email__c, AccountId = a.Id);
					       	insert c;
					       	
				// Update Enquiry record with new Contact	       	
					       	e.Matching_Contact__c = c.Id;
	       	
			}
		}
	}
}

 

 

 

How do I apply CSS to a field level Error message (eg: a validation rule or a required field)?

 

In my page I have used:

<style type="text/css">
.error{border:1px solid #ff0000;}
label.error{display:block; width:200px; font-size:10px; color:#ff0000; border:0; float:none; font-family: arial;}
</style>

 

 

<style type="text/css">
        .error{border:1px solid #ff0000;}
        label.error{display:block; width:200px; font-size:10px; color:#ff0000; border:0; float:none; font-family:  arial;}
</style>

 

 

Which is putting a nice red border around inputs with errors (as it should). But the error message itself is still displaying in Black, 12pt, Times New Roman.

Any ideas?

 

Any help would be greatly appreciated.

I have a set of VF forms that I have made publicly accessible so as to capture data on a custom object.

I need to be able to hardcode a value in to a hidden field that can be passed onto my object.

 

I know this is easily achieved with Web to Lead (Eg: <input type=hidden value=webform id=LeadSource>)

but how do I achieve the same thing using VF? I can't even work out how to get this done using name/value pairs in the URL to write to the field.

 

Any help would be appreciated.

Is there any way that we could use an email, or landing page to allow for our customers to accept a T&C aggrement so that upon accepting and submitting, their record is updated in SF??
 
Ideally we could include a simple checkbox and submit button into an email.
 
Is there any way to do this?
  • September 04, 2007
  • Like
  • 0
Sorry if this is an entry level question... Im new at all this.

I am trying to create a web-2-lead form within an email so that existing leads have the opportunity to update their details. Ideally, this would have the existing data predefined in the form fields. I have created this nicely in FrontPage '03 exactly as I would like it, and have successfully saved it to the SalesForce 'Email Template' environment. I have no problems opening the template, and at this point all still looks as I want it to.

The only problem occurs on reciept of the email. The input fields and predefined data are nowhere to be seen when the message hits the Inbox!?! Am I doing something wrong or is it simply not possible to include a form in an email template??

I am a little stuck with a page I am trying to create.

 

Basically, I am trying to create a collection of apartment records related to a building parent record. I then want to split this list into the different building levels/floors. Using this data, I want to construct a table on my VF page such that each row represents a floor and each cell represents an individual apartment. 

 

Any suggestions on where to start with this would be greatly appreciated.

 

Thanks in advance.

The trigger below runs through a set of logic looking for matching Contacts/Person Accounts based on email address and creating Accounts/Contacts and Person Accounts where they don't already exist.

 

Everything is working fine except for the bit that is highlighted.

It is supposed to create a new Person Account and then update a lookup with the new Person Account ID.

The Person Account record is being created just fine, but the lookup is not being populated like it is with the rest of the trigger.

If a second record is created with a matching email address, the lookup is populated on the second record as it should.

 

Any idea what I am doing wrong??

 

Thanks is advance for any help.

 

 

trigger enquiryTrigger on Enquiry__c (before insert) {

// Get the email address from the enquiry record
   List<Enquiry__c> enqEmail = [select email__c from Enquiry__c where ID in :Trigger.new];
 
   for(Enquiry__c e: Trigger.new){

// Get the contact with matching email address   	
      List<Contact> conID = [select Name from Contact where Email = :e.email__c limit 1];

// If matching contact is found update Enquiry record      
      if (conID.size() > 0) {
      	e.Matching_Contact__c = conID[0].Id;

      } 

//If no matching contact is found and enquiry DOES NOT contain a Company, create a Person Account

else if (e.company__c == null) {

		Account pa = new Account (RecordTypeId = '01220000000DpJM', LastName = e.Name, PersonEmail = e.Email__c, Phone = e.Phone__c);
		insert pa;
		
		// Update Enquiry with new Person Account      		
		e.Matching_Contact__c = pa.PersonContactId;
      	
       } else {

		// If Enquiry does contain a Company check for matching Account record       	
		       	List<Account> accName = [select Id from Account where Name = :e.Company__c limit 1];
		      
		      	if (accName.size() > 0) {
		
				// If matching Account record is found, create a contact on the existing Account
				      		Contact c = new Contact (LastName = e.Name, Phone = e.Phone__c, Email = e.email__c, AccountId = accName[0].Id);
					       	insert c;
				
				// Update Enquiry with new Contact	       	
					       	e.Matching_Contact__c = c.Id;
	       	
		      	} else {
		      		
				// If no matching Account is found, create an Account        		
					       	Account a = new Account (Name=e.Company__c);
					       	insert a;
					       	
				// Create a related Contact	       	
					       	Contact c = new Contact (LastName = e.Name, Phone = e.Phone__c, Email = e.email__c, AccountId = a.Id);
					       	insert c;
					       	
				// Update Enquiry record with new Contact	       	
					       	e.Matching_Contact__c = c.Id;
	       	
			}
		}
	}
}

 

 

 

How do I apply CSS to a field level Error message (eg: a validation rule or a required field)?

 

In my page I have used:

<style type="text/css">
.error{border:1px solid #ff0000;}
label.error{display:block; width:200px; font-size:10px; color:#ff0000; border:0; float:none; font-family: arial;}
</style>

 

 

<style type="text/css">
        .error{border:1px solid #ff0000;}
        label.error{display:block; width:200px; font-size:10px; color:#ff0000; border:0; float:none; font-family:  arial;}
</style>

 

 

Which is putting a nice red border around inputs with errors (as it should). But the error message itself is still displaying in Black, 12pt, Times New Roman.

Any ideas?

 

Any help would be greatly appreciated.

I have a set of VF forms that I have made publicly accessible so as to capture data on a custom object.

I need to be able to hardcode a value in to a hidden field that can be passed onto my object.

 

I know this is easily achieved with Web to Lead (Eg: <input type=hidden value=webform id=LeadSource>)

but how do I achieve the same thing using VF? I can't even work out how to get this done using name/value pairs in the URL to write to the field.

 

Any help would be appreciated.

SuperNewbie trying to achieve simple task.  I have a VF page for Public Access (customers to fill out warranty info) with a standardController referencing a Custom Object (the warranty info fields). 

 

After entering data and clicking:  commandButton action="{!save}"  I want to redirect user to outside URL (e.g. HTML "thank you" page). 

 

Should I be adding an Extension ( e.g. standardController="Warranty__c" extensions="redirect" ) and if so, I'd love a sample of the correct Apex Class code.

 

The closest I've gotten is to have the page redirect upon loading.  A bit premature I'm afraid.

Thanks in advance to anyone willing to help a non-developer develop.  :)

Message Edited by kenzo on 10-30-2009 12:23 PM
Message Edited by kenzo on 10-30-2009 12:25 PM
  • October 30, 2009
  • Like
  • 0