• Jerry Hong
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I have a contact form written in VF using Sites. However it seems when the lead is inserted, the owner assignment rules are not firing and the owner just remains the website.

 

I have a number of rules set up in Lead Assignment Rules and would like to use them. Is there something I am missing?

 

Here's the controller code:

global with sharing class ContactFormController {

    Lead lead;
    CampaignMember cmember;
    String submittedPageURL = 'http://asc-net.force.com/cms__Main?name=contact_confirm';
    
    global Lead getLead() {
        if(lead == null)
            lead = new Lead(firstname='First Name...',lastname='Last Name...');
        return lead;
    }
    
    global CampaignMember getCmember() {
        if(cmember == null)
            cmember = new CampaignMember(status='Responded');
        return cmember;     
    }

    global PageReference save() {
        //System.debug('Made it to save!');
        insert lead;
        //System.debug('Inserted Lead');
        
        if(cmember.CampaignId != null) {
            cmember.LeadId = lead.id;
            insert cmember; 
            //System.debug('Inserted Campaign Member');
        }
            
        PageReference submittedPage = new PageReference(submittedPageURL);
        submittedPage.setRedirect(true);
        //System.debug('Redirecting and we are outta here!');
        return submittedPage; 
        
    }
    
}

 

I tried last year without success.... Is there anyone in the South Jersey / Philly area that has any interest in attending the DEV 531 Class ????

 

I am trying to get 6 people so we can have a class in Philly.  The May class that was scheduled in NY has been moved to Boston.

 

Anyone?

  • April 20, 2011
  • Like
  • 0

Below is a live list of Salesforce.com opportunities. Let us know if you or anyone you know may be interested in finding out more:

 

Force.com Developers / Technical Architects

 

1) 6 mth contract in London for a Consulting firm paying around £450-500 per day for excellent Visualforce and Apex skills plus good client facing skills

2) 6 mth contract in London for a Telecoms company paying around£450-500 per day for excellent Visualforce and Apex programming and DEV401 certification

3) 3 mth contract in London for a Marketing company paying around £400-450 per day for good experience as a Developer with no less than 1 year on Force.com platform

4) 6 mth contract in Merseyside for a Media company looking to pay around £450-500 per day for a Senior Force.com Developer

5) Perm position with Consulting firm in London paying c£60k-70k for a good Developer with around 2 years Force.com Development experience

6) Perm position with Consulting firm in Berkshire paying c£60-70k for a good Developer with 2+ years’ experience on the Force.com platform

7) Perm position with Consulting firm in Essex paying c£60-70k  for an experienced Force.com Developer / Technical Architect

 

Salesforce.com Consultants / Business Analysts / Project Managers

 

1) 6 mth contract in London for a Consulting firm paying around £450-500 per day for CON201 certified plus very experienced Salesforce.com Consultant

2) 6 mth contract in Amsterdam for a Consulting firm paying £500 per day for a Dutch speaking Salesforce.com Consultant and Project Manager

3) Perm position with global Consulting firm in London, Edinburgh and Midlands paying c£60-80k for top Salesforce.com Consultants and Project Managers

4) Perm Management position with Consulting company in London paying c£70-75k for strong Salesforce.com Consulting and Management / Team Leader experience

5) Perm position with Consulting company in Leeds and Newcastle for Salesforce.com Consultants paying c£40-45k for 1 year + Salesforce.com experience

6) Perm Sales Operations Manager role with Marketing company in Hertfordshire paying c£45-55k for Sales Operations Management experience in a Salesforce.com environment

7) Perm Salesforce.com Analyst role for a Financial Organisation in London paying c£40-45k for 2 years + Salesforce.com Analysis and configuration experience

8) Perm Junior Salesforce.com Consultant in Gloucester for Consulting company paying c£25-35k for decent Salesforce.com understanding and desire to learn

 

Salesforce.com Administrators

 

1) 3 mth contract in Hampshire for an ADM201 certified Administrator with over 2 years Salesforce.com experience paying c£300-350 per day

2) Perm Customer Success Manager role for a Consultancy in Gloucester paying c£25k per annum for a junior Salesforce.com Administrator willing to learn and become certified

3) Perm Salesforce.com Administrator role in Hertfordshire for a Marketing company paying c£40k for good configuration and support experience

4) Perm Salesforce.com Analyst and Administrator in London for a Financial organisation paying c£40k for solid Salesforce.com configuration and support experience

5) Perm Junior Consultant roles for Consultancies in London willing to train good Salesforce.com Administrators to become experienced and certified Consultants. Paying c£30-40k plus training.

 

This list is not exhaustive and changes daily so if you are on the market but do not see something that matches your criteria, please let rod@resourceondemand.com know as we will most likely have other opportunities to discuss with you.

Hi:

   If a SOQL Query has no records I keep getting List Out Of Bounds:0..

 

How can I write a message stating to the user " There are no records for the filters selected" onto my VF Page???

 

Thanks

eTechCareers

I have created a custom object called PTO. I have also created an approval process for it.  How can I create a  trigger so that it automically executed the approval process i have setup as soon as a new PTO record is created(inserted).  This would behave the same way as if I manually pressed the submit approval button.

 

trigger PTO_Trigger on PTO__c (after insert) 
{
for(PTO__c pto: [select id from pto__c])
{
Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
req1.setObjectId(pto.id);
}
}

 

 

 

Message Edited by bikla78 on 07-15-2009 11:49 PM
Hello

I am trying to delete some Apex triggers from our production org through Eclipse and keep getting the following error (from the force-ide.log):

ERROR [2008-12-01 14:49:30,051] (DeleteRefactorController.java:performRemoteDelete:253) - Remote delete failed with the following message.  Delete will be aborted.
  package.xml: null
  Attendence_updateScore: null

Also I can't delete the triggers from the salesforce web interface. It works in our Sandbox but I need to get rid of the triggers in the production org so I can deploy a new object.

Any help would be hugely appreciated

Thanks
Matt
I want to cancel the Lead INSERT event in case there is another Lead from the same source(e.g. with same e-mail address) and update the old Lead with the required information. In other words I want to create a new Lead only in case there is not existing one in the system from the same source.

I tried with the combinations of update, insert triggers but got  errors. Is there a functionality of Instead of Trigger in salesforce?

Any suggestions will be appreciated.


I've made some headway in creating a testmethod for my trigger that will populate a contacts Mobile phone and Phone2 on a newly created task.
However, I can't seem to figure out what to do to get my Test Coverage over 75% (It's currently 71%).

Does anything jump out that might indicate where issue (or most likely, issues) lie?

Trigger Code:
Code:
trigger Copy_Contact_Cell_and_Mobile_To_Task_Record on Task (after insert) 
{
Id ContactIDOnTheTask;
String contactCellNumber;
String contactPhone2;
    for (Task TReadOnly : Trigger.new)
if (TReadOnly.RecordTypeID == '012500000009Kbp')//Limit Code to only FID Tasks
 {//IfOpening
     {
        Task t = [select Id, WhoID from Task where Id = :TReadOnly.Id  limit 1]; //get ContactID
ContactIDOnTheTask= t.WhoID;
Contact[] phoneValueArray = [Select c.Id,c.mobilePhone,c.Phone_2__c from Contact c 
where c.Id = :ContactIDOnTheTask limit 1]; 
for(Integer i=0;i<phoneValueArray.size();i++)
   {//4
contactCellNumber = phoneValueArray[0].mobilePhone;  //grab mobile number from array
contactPhone2 = phoneValueArray[0].Phone_2__c;  //grab phone2 number from array
t.Mobile__c = contactCellNumber;  //set mobile custom field on task to the contact mobile number
t.Phone2__c = contactPhone2;  //set phone2 custom field on task to contact phone2 number
   }//4
  update t;
  }
 }//IfClosing
}

TestMethod:
Code:
public class taskTriggerTestMethod {//1

static testMethod void myTest() {//2
//Declare Variables
Id ContactIDOnTheTask;
String contactCellNumber ;
String contactCellNumber2 ;
String acontactPhoneNumber2;
String bcontactPhoneNumber2;
date taskydate = System.today();
 // Create two Tasks for test
   Task t1 = new task(ActivityDate = taskydate, OwnerId ='00530000000hxwA',   Results__c = 'Contact', Subject='Task1Test', WhoID = '0035000000RzAaw', RecordTypeID = '012500000009Kbp');
insert t1;
 
 Task t2 = new task(ActivityDate = taskydate, OwnerId ='00530000000hxwA', Results__c = 'Contact', Subject='Task2Test', WhoID = '0035000000RzAaw', RecordTypeID = '012500000009Kbp');
 insert t2;  


 //Grab Details From Task 1
 Task t = [select Id, WhoID, Mobile__c,Phone2__c from Task where Id = :t1.Id  limit 1]; //get ContactID


Contact[] phoneValueArray = [Select c.Id,c.mobilePhone,Phone2__c from Contact c 
where c.Id = :t.WhoID limit 1]; 
for(Integer i=0;i<phoneValueArray.size();i++)
   
acontactPhoneNumber2 = phoneValueArray[0].Phone2__c; //grab Phone 2 from array
contactCellNumber = phoneValueArray[0].mobilePhone;  //grab mobile number from array

  
//Grab Details From Task 2
Task t4 = [select Id, WhoID, Mobile__c,Phone2__c from Task where Id = :t2.Id  limit 1]; //get ContactID

Contact[] phoneValueArray2 = [Select c.Id,c.mobilePhone,Phone2__c from Contact c 
where c.Id = :t4.WhoID limit 1]; 
for(Integer i=0;i<phoneValueArray2.size();i++)
   
bcontactPhoneNumber2 = phoneValueArray2[0].Phone2__c;
contactCellNumber2 = phoneValueArray2[0].mobilePhone;  //grab mobile number from array
  
//Tests
  System.assert(t1.ID != NULL);
  System.assert(t2.ID != NULL);
  System.assertEquals(t1.Mobile__c,contactCellNumber);
  System.assertEquals(t2.Mobile__c,contactCellNumber2);
  System.assertEquals(t1.Phone2__c,acontactPhoneNumber2);
  System.assertEquals(t2.Phone2__c,bcontactPhoneNumber2);
 
 } 
}//1

 Debug Log:
Code:
*** Beginning Test 1: taskTriggerTestMethod.static testMethod void myTest()

20080108223753.034:Class.taskTriggerTestMethod.myTest: line 13, column 1: Insert: SOBJECT:Task
*** Beginning Copy_Contact_Cell_and_Mobile_To_Task_Record on Task trigger event bulk AfterInsert for 00T5000000dkDiT

20080108223753.087:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 6, column 5: SelectLoop:LIST:SOBJECT:Task
20080108223753.087:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 10, column 18: SOQL query with 1 row finished in 6 ms
20080108223753.087:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 12, column 29: SOQL query with 1 row finished in 4 ms
20080108223753.087:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 21, column 3: Update: SOBJECT:Task
20080108223753.087:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 21, column 3: DML Operation executed in 28 ms

Cumulative resource usage:

Resource usage for namespace: (default)
Number of SOQL queries: 2 out of 100
Number of query rows: 2 out of 500
Number of DML statements: 2 out of 100
Number of DML rows: 2 out of 500
Number of transaction control statements: 0 out of 0
Number of script statements: 20 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10

Total email recipients queued to be sent : 0
Static variables and sizes:
Copy_Contact_Cell_and_Mobile_To_Task_Record:ContactIDOnTheTask:18
Copy_Contact_Cell_and_Mobile_To_Task_Record:contactCellNumber:0
Copy_Contact_Cell_and_Mobile_To_Task_Record:contactPhone2:10


*** Ending Copy_Contact_Cell_and_Mobile_To_Task_Record on Task trigger event bulk AfterInsert for 00T5000000dkDiT

20080108223753.034:Class.taskTriggerTestMethod.myTest: line 13, column 1: DML Operation executed in 92 ms
20080108223753.034:Class.taskTriggerTestMethod.myTest: line 16, column 2: Insert: SOBJECT:Task
*** Beginning Copy_Contact_Cell_and_Mobile_To_Task_Record on Task trigger event bulk AfterInsert for 00T5000000dkDiU

20080108223753.155:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 6, column 5: SelectLoop:LIST:SOBJECT:Task
20080108223753.155:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 10, column 18: SOQL query with 1 row finished in 3 ms
20080108223753.155:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 12, column 29: SOQL query with 1 row finished in 5 ms
20080108223753.155:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 21, column 3: Update: SOBJECT:Task
20080108223753.155:Trigger.Copy_Contact_Cell_and_Mobile_To_Task_Record: line 21, column 3: DML Operation executed in 27 ms

Cumulative resource usage:

Resource usage for namespace: (default)
Number of SOQL queries: 4 out of 100
Number of query rows: 4 out of 500
Number of DML statements: 4 out of 100
Number of DML rows: 4 out of 500
Number of transaction control statements: 0 out of 0
Number of script statements: 34 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10

Total email recipients queued to be sent : 0
Static variables and sizes:
Copy_Contact_Cell_and_Mobile_To_Task_Record:ContactIDOnTheTask:18
Copy_Contact_Cell_and_Mobile_To_Task_Record:contactCellNumber:0
Copy_Contact_Cell_and_Mobile_To_Task_Record:contactPhone2:10


*** Ending Copy_Contact_Cell_and_Mobile_To_Task_Record on Task trigger event bulk AfterInsert for 00T5000000dkDiU

20080108223753.034:Class.taskTriggerTestMethod.myTest: line 16, column 2: DML Operation executed in 63 ms
20080108223753.034:Class.taskTriggerTestMethod.myTest: line 20, column 11: SOQL query with 1 row finished in 3 ms
20080108223753.034:Class.taskTriggerTestMethod.myTest: line 23, column 29: SOQL query with 1 row finished in 6 ms
20080108223753.034:Class.taskTriggerTestMethod.myTest: line 32, column 11: SOQL query with 1 row finished in 3 ms
20080108223753.034:Class.taskTriggerTestMethod.myTest: line 34, column 30: SOQL query with 1 row finished in 6 ms
System.Exception: Assertion Failed: Expected: null, Actual: 1234567890

Class.taskTriggerTestMethod.myTest: line 46, column 3


Cumulative resource usage:

Resource usage for namespace: (default)
Number of SOQL queries: 8 out of 100
Number of query rows: 8 out of 500
Number of DML statements: 4 out of 100
Number of DML rows: 4 out of 500
Number of transaction control statements: 0 out of 0
Number of script statements: 49 out of 200000
Maximum heap size: 0 out of 500000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10

Total email recipients queued to be sent : 0
Stack frame variables and sizes:
Frame0

*** Ending Test taskTriggerTestMethod.static testMethod void myTest()

 


 


  • January 08, 2008
  • Like
  • 0

What is the difference between the SytemModStamp and LastModifiedDate fields.  Please give an example.

Michael S. Scherotter