• tcash21
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

I've had this problem now for months and finally am resorting to custom coding.

 

All I need to be able to do is figure out how many days it has been since a lead or account has been contacted.

We have a caveat though in that we need to filter out marketing activities so there's a filter that looks like "Assigned != 'Marketing'" at the Tasks/Events level.

 

How difficult would it be to write a trigger in Apex to fill in the most recent Completed Task/Event not assigned to "Marketing" date on an account or lead record?

Is this even possible? And would it be on or before an update/insert? 

 

I'm extremely new to apex coding, but am hoping someone else has had a similar problem and may even have a bit of code to share.

 

Thank you.

I'm trying to mass move reports via the Force.com IDE.

 

I follow the exact steps outlined by SarathPM here: http://success.salesforce.com/questionDetail?qId=a1X30000000IEOSEA4

 

Everytime I try to "Save to Server" after making the appropriate changes I get an error popup that says "Project is not synchronized with the associated Salesforce organization. Do you want to cancel deployment and open Synchronize?" I've clicked No and deployed anyway, which finally worked after many trials.

 

Is this something I should be concerned about? Is there a way to synchronize the project so I don't recieve this message? I'm working on the deployment environment, not sandbox. I've tried opening synchronize view and synchronizing from there first, then making changes but the message always pops up.

 

Thanks.

I've followed the instructions here step-by-step: http://youraveragesalesforceadmin.blogspot.com/2011/05/mass-moving-reports-from-one-folder-to.html

 

However, I keep getting this error when trying to move reports:

Save error: DeveloperName: This Report Unique Name already exists or has been previously used.  Please choose a different name.
Save error: duplicate value found: <unknown> duplicates value on record with id: <unknown>  

Hi all,

 

I'm writing my very first bit of code in Apex. I'd like to write a trigger that updates a Lead's Status to "Working" as soon as the Lead Owner is changed.

 

Here's my trigger:

trigger test on Lead (after update) {
  Lead leadOld = trigger.old[0];
  Lead leadNew = trigger.new[0];
	if(leadOld.OwnerId != leadNew.OwnerId){
		leadNew.Status = 'Working';
	}
}

 

Here's my attempt at simply modifying the Apex docs test code:

 

@isTest
private class LeadStatusOwnerTriggerTest{

static TestMethod void TestInsert()
{
    //First, prepare 200 Leads for the test data
    Account acct = new Account(name='test account');
    insert acct;
    
    Lead[] leadsToCreate = new Lead[]{};
    for(Integer x=0; x<200;x++){
        Lead ld = new Lead(OwnerId=acct.OwnerId,lastname='testing',firstname='apex');
        leadsToCreate.add(ld);
    }
    
    //Now insert data
    Test.startTest();
    insert leadsToCreate;
    Test.stopTest();    
    
    }
}

 

I am getting this error:

System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Owner ID: owner cannot be blank: [OwnerId]    LeadStatusOwnerTriggerTest.cls  SFDC/src/classes    line 18    Force.com run test failure

Also, I know I will eventually need to change the Lead OwnerId to fully test my trigger, but that field is not writeable.

 

Thanks for any help.

I'm trying to mass move reports via the Force.com IDE.

 

I follow the exact steps outlined by SarathPM here: http://success.salesforce.com/questionDetail?qId=a1X30000000IEOSEA4

 

Everytime I try to "Save to Server" after making the appropriate changes I get an error popup that says "Project is not synchronized with the associated Salesforce organization. Do you want to cancel deployment and open Synchronize?" I've clicked No and deployed anyway, which finally worked after many trials.

 

Is this something I should be concerned about? Is there a way to synchronize the project so I don't recieve this message? I'm working on the deployment environment, not sandbox. I've tried opening synchronize view and synchronizing from there first, then making changes but the message always pops up.

 

Thanks.

Hi all,

 

I'm writing my very first bit of code in Apex. I'd like to write a trigger that updates a Lead's Status to "Working" as soon as the Lead Owner is changed.

 

Here's my trigger:

trigger test on Lead (after update) {
  Lead leadOld = trigger.old[0];
  Lead leadNew = trigger.new[0];
	if(leadOld.OwnerId != leadNew.OwnerId){
		leadNew.Status = 'Working';
	}
}

 

Here's my attempt at simply modifying the Apex docs test code:

 

@isTest
private class LeadStatusOwnerTriggerTest{

static TestMethod void TestInsert()
{
    //First, prepare 200 Leads for the test data
    Account acct = new Account(name='test account');
    insert acct;
    
    Lead[] leadsToCreate = new Lead[]{};
    for(Integer x=0; x<200;x++){
        Lead ld = new Lead(OwnerId=acct.OwnerId,lastname='testing',firstname='apex');
        leadsToCreate.add(ld);
    }
    
    //Now insert data
    Test.startTest();
    insert leadsToCreate;
    Test.stopTest();    
    
    }
}

 

I am getting this error:

System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Owner ID: owner cannot be blank: [OwnerId]    LeadStatusOwnerTriggerTest.cls  SFDC/src/classes    line 18    Force.com run test failure

Also, I know I will eventually need to change the Lead OwnerId to fully test my trigger, but that field is not writeable.

 

Thanks for any help.