• MaxPowerForce
  • NEWBIE
  • 239 Points
  • Member since 2013

  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 40
    Replies
Hi,

I'm getting an error on my trigger when I call the email class I created.  The Line in red is the one causing the error.  
I'm new to apex and any help would be appreciated .
Thanks, Vanessa

The Error

Method does not exist or incorrect signature: [AccCreatedEmailAlert].sendMail(LIST<Task>, SOBJECT:Task)

Class Code

public class AccCreatedEmailAlert{
public static void sendMail (User u, Task t) {
User u1 =[select Email from User where Id =: t.OwnerId limit 1];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddress = new String[] {u1.Email};
mail.setToAddresses(toAddress);
mail.setSubject('CS-Accommodation Order Task Created');
mail.setPlainTextBody('You are being sent this email because an CS-Accommodation Order Task has been created and assigned to you.\n\nThanks, SFDC');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
}
}


Trigger Code

  User-added image


  • May 30, 2014
  • Like
  • 0
Hi,

I wrote a class to send an email and I'm getting an error when I try to save it to the Sandbox.

INVALID_CROSS_REFERENCE_KEY:invalid cross reference id
The only thing being referenced is a custom field on Task.  Assigned_To_Email__c, the custom field is a formula.
I double checked to make sure it was accessible by all users.  
I'm an Administrator working in a Sandbox so I should have access to all fields.
What level of access is needed to get past the error?

Thanks, Vanessa

Class Code:

public class SendEmailCreated{   
public void sendMail (User u, Task t) {
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String [] toAddress = New String [] {t.Assigned_To_Email__c};
mail.setToAddresses(toAddress);
mail.setSubject('CS-Accommodation Order Task Created');
mail.setPlainTextBody('You are being sent this email because an CS-Accommodation Order Task has been created and assigned to you.\n\nThanks, SFDC');

Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
}

}





  • May 29, 2014
  • Like
  • 0
Hello,

we have a scenario here where we are providing a functionality to user to change his own profile through Apex visualforce page.

We are aware about Salesforce limitation to change own profile but stil is there any bypass for this?
  • May 29, 2014
  • Like
  • 0
I'm getting the "Too many SOQL queries" error on Line 17. Help me troubleshoot?

trigger InsideSalesAppointment on Task (after insert, after update) {

Map<Id,Date> LeadsToUpdate = new Map<Id,Date>();
List<User> InsideSalesUser = [SELECT Id FROM User where UserRoleId='00E30000001rctV'];
Set<Id> InsideSalesUserId = new set<Id>();
for (User u :InsideSalesUser) {
    InsideSalesUserId.add(u.Id);
    }


for (Task t: Trigger.new) {
    if(InsideSalesUserId.contains(t.OwnerID) && t.IsClosed == false && String.valueOf(t.WhoId).startsWith('00Q') && t.WhoId != NULL)
    
    LeadsToUpdate.put(t.WhoId, t.ActivityDate);
    }

List<Lead> LeadsAppointment = [SELECT Id FROM Lead where Id IN:LeadsToUpdate.keyset()];

if (LeadsToUpdate.keyset().size()>0){

for (Lead l: LeadsAppointment) {

    l.Next_Appointment_Date__c = LeadsToUpdate.get(l.id);
    }
    update LeadsAppointment;
}
}


Hi guys, 

I'm trying to query a field from an object to see what was the last number and increament the number by 1. Then assign that to a new record when it's created. But I'm getting null pointer on the query. Please someone point me why.

public PageReference save(){

List<Expense_Line_Item__c> insertExpenseList = new List<Expense_Line_Item__c>();
       
        insertExpenseList.add(ELI2);

Expense_Line_Item__c exp = new Expense_Line_Item__c();
        exp = [select expense__c, id, Number_of_item__c from Expense_Line_Item__c where expense__c =:ELI2.expense__c order by Number_of_item__c ASC limit 1];
        insertExpenseList[0].Number_of_item__c = exp.Number_of_item__c+1;
.......
}
I have this in my construction:

this.ELI2 = (Expense_Line_Item__c)controller.getRecord();

I have tried assigning just a single number instead of the query. It runs fine but as soon as I assign exp.Number_of_item__c+1, it gives error. 
Hi guys,

I'm pulling my hair out with this one, as almost identical code is working fine in another class!

I'm trying to run the below code and I'm getting a consistent error: FATAL_ERROR|System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, Invalid to address : null: []

When I debug the toAddresses list and the whoel mail message it's not taking any of the inputs!

global class NBAAForward implements Messaging.InboundEmailHandler {

global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
 
  Messaging.reserveSingleEmailCapacity(1);
 
  Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
 
  Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

  String[] toAddresses = new String[] {'nickc@magellanjets.com'};
  String[] ccAddresses = new String[] {email.fromAddress};

  mail.setToAddresses(toAddresses);
  system.debug(mail.toAddresses);
  mail.setCcAddresses(ccAddresses);
 
  mail.setSenderDisplayName('Magellan Jets');
 
  mail.setSubject(email.Subject);
 
  mail.setBccSender(false);
 
  mail.setUseSignature(false);
 
  mail.setPlainTextBody('PLEASE REPLY TO ' + email.fromAddress + '\n \n' + email.plainTextBody);
  system.debug(mail);
  Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
  
  return result;
}

public static testmethod void testEmail() {
 
  // create new email for testing
  Messaging.InboundEmail email = new Messaging.InboundEmail();
  Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
 
  email.subject = 'test nbaa post';
  env.fromAddress = 'chris@magellanjets.com';
 
  email.plainTextBody = 'TEST NBAA POST';
 
  NBAAForward emailServiceObj = new NBAAForward();
  emailServiceObj.handleInboundEmail(email, env);
 
}

}

I am trying to create a trigger that will update an opportunity field called "Tinderbox_Sites__c" after a child object called "Site__c" is inserted with a list of all the child Site names. I have created the below trigger and helper class method but for some reason, when there are multiple child sites, the string will just overwrite instead of concatenate the site names. For example,

 

Opportunity A has two child Site__c objects:

- Site 1

- Site 2

 

The "Tinderbox_Sites__c" opportunity field will only display

"Site 2<br />"

 

instead of the expected concatenated string of sites

"Site 1<br />Site 2<br />"

 

. Can anyone help me figure out why the string is overwriting instead of concatenating? Thanks!

 

 

trigger SiteTrigger on Site__c (after insert) {
    
  SiteTriggerHelper helper = new SiteTriggerHelper();

  if(Trigger.isAfter && Trigger.isInsert){
    helper.updateTinderboxSites(Trigger.new);
  }
}

 

 

public void updateTinderboxSites(List<Site__c> sites){

  Set<Id> opportunityIds = new Set<Id>();
  for(Site__c s: sites){
    opportunityIds.add(s.Opportunity__c);
  }
  List<Opportunity> opps = new List<Opportunity>([select Id, Tinderbox_Sites__c from Opportunity where Id in : opportunityIds]);
  List<Opportunity> oppsToUpdate = new List<Opportunity>();
  for(Opportunity o: opps){
    String html = '';
    for(Site__c oppSite: sites){
      html += oppSite.Name+'<br />';
    }
    o.Tinderbox_Sites__c = html;
    oppsToUpdate.add(o);
  }
  update oppsToUpdate;
}

 

 

 

Hello,

 

Im receiving the error in the subject line. Im trying to loop through records in a custom object and load them into the Contact object. Here is the code...

 

public list<Contact> contactInsertItem {get;set;}
public list<Contact> contactInsertList {get;set;}

public SalesConnectContactQuickBuildController (ApexPages.StandardSetController controller) {
...
	List<CustomObject1__c> unmatchedContactList = new List<CustomObject1__c>([SELECT field1__c, field2__c, field3__c FROM CustomObject1__c WHERE Id in :tempSet]);
	
	for(integer i=0; i<unmatchedContactList.size();i++){
			
        	contactInsertItem = new list<Contact>();
        	//***error occurs here*** contactInsertItem.field1__c = unmatchedContactList[i].field1__c;
        	contactInsertItem.field2__c = unmatchedContactList[i].field2__c;
        	contactInsertItem.field3__c = unmatchedContactList[i].field3__c;
        	contactInsertItem.field4__c = unmatchedContactList[i].field4__c;
        	contactInsertItem.field5__c = unmatchedContactList[i].field5__c;
			
		contactInsertList.add(contactInsertItem);
	}
...
}

 What am I doing incorrectly?

I have an extremely basic trigger that is designed to delete any task with a blank subject when it's created:

 

trigger deleteBlankSubjects on Task (after insert){

  list<Task> records = trigger.new;
  list<Task> deletable = new list<Task>();
		
    for(Task t : records){
      if(t.Subject == null || isBlank(t.Subject)){
        deletable.add(t);					
      }
    }
  delete deletable;		
}

 

For some reason though, whenever I write out the isBlank() method, I get the error, "Save error: Method does not exist or incorrect signature: isBlank(String)".  

 

I've tried writing it a bunch of different ways now, and every time I get the same error.  What's worse, is that I can't seem to find any examples of people using the APEX .isBlank() method on google (where I usually turn when I'm stuck), even though the APEX Handbook says it's perfectly allowable.  What am I doing wrong here???  Totally confused.

 

I'm using Eclipse if it's of any help.  Any insight from any guru's out there would be HUGELY appreciated.

We are on NA2 and change sets are taking about 6-10+ times longer to deploy than last week.  Is anyone else seeing this issue?  Support advised there is no SLA for deployments, but this is a very significant increase.
We are on NA2 and change sets are taking about 6-10+ times longer to deploy than last week.  Is anyone else seeing this issue?  Support advised there is no SLA for deployments, but this is a very significant increase.
I have a Scheduled Batch Apex job that has been running nightly for a couple of months now. The start method does a relatively simple query to get a QueryLocator for a bunch of Attachments. Last night, I got the following error message:

Subject: Developer script exception from <my org name> : 'Batch_Attachments' : java.io.IOException: Missing cursor chunk (offset 0, count 400), key: V:SFDC::x/<my org id>/T/01ga000001i0STTAA2/0.cursor

Apex script unhandled exception by user/organization: 005a0000007hfmB/<my org id>

Failed to process batch for class 'Batch_Attachments' for job id '707a000001BYsGh'


No line number - this appears to be a failure in the Batch Apex system, not in the Apex code. 

Any thoughts on what it means, why it happened, or how to avoid it in the future?

Thanks!
I would like hear from anyone who may have had this similar experience with invoking the default Case assignment rule on in Apex. The Apex code would be something as follows:

Database.DMLOptions dmo = new Database.DMLOptions();

dmo.assignmentRuleHeader.useDefaultRule = true;

Case c = new Case(Status = 'New') ;

c.setOptions(dmo);

insert c;

The intention is to set the owner of the Case by invoking the business rules defined in the default assignment rule. If the assignment rule fails to locate an owner the default Case owner is set as the Case owner. The default Case owner is configured in Set Up / App Setup / Customize / Cases / Support Settings.

What do you think happens when the default assignment rule is inactive, e.g.: there are no active assignment rules? I thought the creator of the Case would be the owner of the Case, but not so, the behavior is such that as if phantom assignment rules are invoked and a owner is failed to be located resulting in the default Case owner being assigned as the owner. The same behavior is exhibited even when all assignment rules are deleted. The only way to remove the phantom rules is to remove the useDefaultRule call from the Apex code.

While I don't see a scenario where a business would completely stop using Case assignment rules after implementing them, I do see this as a probable classic bug. It looks like there is a switch statement behind the useDefaultRule call with a default block where the assignment of the default Case owner is occurring, and this default block is being reached because the condition of “no rules” is being treated same as the condition of ”no owner located”.
Hi,

We have developed an apex class using the email service functionality. Everything works fine, emails sent to the long email service, are properly capture and sent to the correct object. With all info.

This is a service for end customers so providing a looong email service is not an option. So to resolve this what we are doing is using a short custom email (with google apps) and a forward all to the looong email service.

We have done this in the past and basically google email sents a confirmation number in order to approve the redirection. This confirmation number comes in a automated email which in the past we have succsefully find in the "Unresolved items", however this shortcut is not available anymore.

Any ideas where we can check the "Inbox" for this email service? In order to find the confirmation code sent by google and approve the redirection? Or where is this unresolved items?

Thanks, any help greatly appreciated.
I downloaded the Salesforce labs case assignment unmanaged package and hacked the trigger to round robin assign leads, which works great.

I tried to update the test code, but every time I run the test I get a MIXED_DML_OPERATION error on 4 different lines of code.  I've researched the error and found some advice, but I haven't been able to implement the fixes that people suggested.  Can any help me fix these errors?

Here is the test class:
 
@isTest
public class TestLeadAssignment{

    static testMethod void myTest1() {

        // This code runs as the system user

        User u1;

        try{
          u1 = [select Id from User WHERE IsActive=True AND Profile.Name = 'System Administrator'  LIMIT 1];
        } catch (QueryException qe){

        List<User> users = [SELECT Id, Profile.PermissionsModifyAllData FROM User WHERE IsActive = true LIMIT 1000];

        for(User u : users){
            if(u.Profile.PermissionsModifyAllData = true){
              u1 = u;
              break;
        }
        }

        }

        System.debug(u1);

       //*****Create Queue
      
       Group testGroup = new Group ();
       testGroup.Name = 'TestQueue';
       testGroup.Type = 'Queue';
       insert testGroup;
      
       QueueSObject testQueue = new QueueSObject();
       testQueue.QueueId = testGroup.id;
       testQueue.SObjectType = 'Lead';
       insert testQueue;

       // Second Queue      
       Group testGroup2 = new Group ();
       testGroup2.Name = 'TestQueue2';
       testGroup2.Type = 'Queue';
       insert testGroup2;
      
       QueueSObject testQueue2 = new QueueSObject();
       testQueue2.QueueId = testGroup2.id;
       testQueue2.SObjectType = 'Lead';
       insert testQueue2;


       test.starttest();
       
        //Run test

        //Assign Lead with out any Assignment Groups
        Lead ld = new Lead (FirstName='Tim',LastName='Jones', Company='ABC Corp', tempOwnerID__c=testGroup2.id, OwnerID=u1.id); //tempOwnerID__c=testGroup2.id, 
        insert ld;
        update ld;
       
       
        //Create Assignment Group
        Assignment_Group_Name__c ag1 = new Assignment_Group_Name__c (Name='TestAG', Type__c = 'Lead');
        insert ag1;

        
        //Add bad queue name
        Assignment_Group_Queues__c agqBad = new Assignment_Group_Queues__c(name='Bad Queue',Assignment_Group_Name__c = ag1.id );

        try {
            insert agqBad;
        } catch (DmlException e){
             System.assert(e.getMessage().contains('CUSTOM_VALIDATION_EXCEPTION'), e.getMessage());
       
        } //catch

        test.stoptest();
       
    }
   
    static testMethod void myTest2() {

        // This code runs as the system user

        User u1;

        try{
          u1 = [select Id from User WHERE IsActive=True AND Profile.Name = 'System Administrator'  LIMIT 1];
        } catch (QueryException qe){

        List<User> users = [SELECT Id, Profile.PermissionsModifyAllData FROM User WHERE IsActive = true LIMIT 1000];

        for(User u : users){
            if(u.Profile.PermissionsModifyAllData = true){
              u1 = u;
              break;
        }
        }

        }

        System.debug(u1);

       //*****Create Queue
      
       Group testGroup = new Group ();
       testGroup.Name = 'TestQueue';
       testGroup.Type = 'Queue';
       insert testGroup;
      
       QueueSObject testQueue = new QueueSObject();
       testQueue.QueueId = testGroup.id;
       testQueue.SObjectType = 'Lead';
       insert testQueue;

       // Second Queue      
       Group testGroup2 = new Group ();
       testGroup2.Name = 'TestQueue2';
       testGroup2.Type = 'Queue';
       insert testGroup2;
      
       QueueSObject testQueue2 = new QueueSObject();
       testQueue2.QueueId = testGroup2.id;
       testQueue2.SObjectType = 'Lead';
       insert testQueue2;


       test.starttest();
       
        //Run test
      
       
        //Create Assignment Group
        Assignment_Group_Name__c ag1 = new Assignment_Group_Name__c (Name='TestAG', Type__c = 'Lead');
        insert ag1;       

        //Add Good Queue to Assignment Group
        Assignment_Group_Queues__c agq1 = new Assignment_Group_Queues__c(name=testGroup.Name ,Assignment_Group_Name__c = ag1.id );
        insert agq1;
       
       
        //Add User to Assignment Groups Users
        Assignment_Groups__c agu1 = new Assignment_Groups__c (User__c = u1.id, Active__c='True', Group_Name__c = ag1.id, Last_Assignment__c = datetime.valueOf('2009-01-01 21:13:24') );
        insert agu1;

        Lead l2 = new Lead (FirstName='Tom',LastName='Dunn', Company='JKL Corp', tempOwnerID__c=testGroup2.id , OwnerID=testGroup.id); //Set owner ID to Queue
        insert l2;
        update l2;       

        test.stoptest();
       
    }

    static testMethod void myTest3() {

        // This code runs as the system user

        User u1;

        try{
          u1 = [select Id from User WHERE IsActive=True AND Profile.Name = 'System Administrator'  LIMIT 1];
        } catch (QueryException qe){

        List<User> users = [SELECT Id, Profile.PermissionsModifyAllData FROM User WHERE IsActive = true LIMIT 1000];

        for(User u : users){
            if(u.Profile.PermissionsModifyAllData = true){
              u1 = u;
              break;
        }
        }

        }

        System.debug(u1);

       //*****Create Queue
      
       Group testGroup = new Group ();
       testGroup.Name = 'TestQueue';
       testGroup.Type = 'Queue';
       insert testGroup;
      
       QueueSObject testQueue = new QueueSObject();
       testQueue.QueueId = testGroup.id;
       testQueue.SObjectType = 'Lead';
       insert testQueue;

       test.starttest();
       
        //Run test       
       
        //Create Assignment Group
        Assignment_Group_Name__c ag1 = new Assignment_Group_Name__c (Name='TestAG', Type__c = 'Lead');
        insert ag1;       

        //Add Good Queue to Assignment Group
        Assignment_Group_Queues__c agq1 = new Assignment_Group_Queues__c(name=testGroup.Name ,Assignment_Group_Name__c = ag1.id );
        insert agq1;
       
       
        //Add User to Assignment Groups Users
        Assignment_Groups__c agu1 = new Assignment_Groups__c (User__c = u1.id, Active__c='True', Group_Name__c = ag1.id, Last_Assignment__c = datetime.valueOf('2009-01-01 21:13:24') );
        insert agu1;     

        Lead l3 = new Lead (FirstName='Dave',LastName='Barry', Company='CBS Corp', OwnerID=testGroup.id); //Set owner ID to Queue
        insert l3;
        update l3;

        test.stoptest();
       
    }

    static testMethod void myTest4() {

        // This code runs as the system user

        User u1;

        try{
          u1 = [select Id from User WHERE IsActive=True AND Profile.Name = 'System Administrator'  LIMIT 1];
        } catch (QueryException qe){

        List<User> users = [SELECT Id, Profile.PermissionsModifyAllData FROM User WHERE IsActive = true LIMIT 1000];

        for(User u : users){
            if(u.Profile.PermissionsModifyAllData = true){
              u1 = u;
              break;
        }
        }

        }

        System.debug(u1);

       //*****Create Queue
      
       Group testGroup = new Group ();
       testGroup.Name = 'TestQueue';
       testGroup.Type = 'Queue';
       insert testGroup;
      
       QueueSObject testQueue = new QueueSObject();
       testQueue.QueueId = testGroup.id;
       testQueue.SObjectType = 'Lead';
       insert testQueue;
     

       test.starttest();
       
        //Run test

        //Create Assignment Group
        Assignment_Group_Name__c ag1 = new Assignment_Group_Name__c (Name='TestAG', Type__c = 'Lead');
        insert ag1;       

        //Add Good Queue to Assignment Group
        Assignment_Group_Queues__c agq1 = new Assignment_Group_Queues__c(name=testGroup.Name ,Assignment_Group_Name__c = ag1.id );
        insert agq1;
       
          //Test for AG-Queues already assigned to another Assignment Group
        Assignment_Group_Queues__c agq2 = new Assignment_Group_Queues__c(name=testGroup.Name,Assignment_Group_Name__c = ag1.id );
        try {
            insert agq2;
        } catch (DmlException e){
             System.assert(e.getMessage().contains('CUSTOM_VALIDATION_EXCEPTION'), e.getMessage());
        } //catch

        test.stoptest();
    
 
  }
}
Hi,

I'm getting an error on my trigger when I call the email class I created.  The Line in red is the one causing the error.  
I'm new to apex and any help would be appreciated .
Thanks, Vanessa

The Error

Method does not exist or incorrect signature: [AccCreatedEmailAlert].sendMail(LIST<Task>, SOBJECT:Task)

Class Code

public class AccCreatedEmailAlert{
public static void sendMail (User u, Task t) {
User u1 =[select Email from User where Id =: t.OwnerId limit 1];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddress = new String[] {u1.Email};
mail.setToAddresses(toAddress);
mail.setSubject('CS-Accommodation Order Task Created');
mail.setPlainTextBody('You are being sent this email because an CS-Accommodation Order Task has been created and assigned to you.\n\nThanks, SFDC');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
}
}


Trigger Code

  User-added image


  • May 30, 2014
  • Like
  • 0
We have 6 inactive Triggers in our org.  When I run a Code Coverage test in the Developer Console, they show up with 0% coverage.  Are they counting against our 75% minimum?  If so, would the best answer be to comment out the lines (assuming we don't want to delete the code entirely)?
Hi,

I wrote a class to send an email and I'm getting an error when I try to save it to the Sandbox.

INVALID_CROSS_REFERENCE_KEY:invalid cross reference id
The only thing being referenced is a custom field on Task.  Assigned_To_Email__c, the custom field is a formula.
I double checked to make sure it was accessible by all users.  
I'm an Administrator working in a Sandbox so I should have access to all fields.
What level of access is needed to get past the error?

Thanks, Vanessa

Class Code:

public class SendEmailCreated{   
public void sendMail (User u, Task t) {
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String [] toAddress = New String [] {t.Assigned_To_Email__c};
mail.setToAddresses(toAddress);
mail.setSubject('CS-Accommodation Order Task Created');
mail.setPlainTextBody('You are being sent this email because an CS-Accommodation Order Task has been created and assigned to you.\n\nThanks, SFDC');

Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
}

}





  • May 29, 2014
  • Like
  • 0
Hi,

I want to integrate my salesforce org with our internal application.

For ex:  there should be a button on Account object, on click of this button account information(few fields) must be created in that application and unique ID should be returned to salesforce.

What is the best method to follow in this case?(any third party app or API)

Regards,
raj
Hello,

we have a scenario here where we are providing a functionality to user to change his own profile through Apex visualforce page.

We are aware about Salesforce limitation to change own profile but stil is there any bypass for this?
  • May 29, 2014
  • Like
  • 0
hello everyone.  I'm new to the salesforce team at my company and I need help writing my first apex trigger.   I need my trigger to stop an email alert from a workflow rule.  stop the email from going out whenever the following field has a date: Initial Field Visit Completed.   what's been happening is the emails have been going out when the date has been updated.  the only way to update the child record from the parent and have it fire the workflow rule would be to us a trigger.   The workflow rule looks like this:

AND(
OR(
AND(Effort__r.RecordTypeId = '01250000000UISS', Effort__r.Inactive__c = False, Effort_Probability__c < 0.2),
AND(Effort__r.RecordTypeId = '01250000000UISQ', Effort__r.Inactive_FiNet__c = 'False',
OR(Effort_Probability__c < 0.33, ISBLANK(Effort__r.Initial_Field_Visit_Completed__c)))
),

ISPICKVAL(Lead_Source__c , "External Recruiter"),
NOT(ISBLANK(Lead_Accepted_Date__c)),
ISBLANK(Lead_Disqualified_Date__c),
ISBLANK(Lead_Expired_Date__c),
Inactive__c = False,
ER_Email__c <> "",
Today() <= DQ_Reminder_Date__c


)

Could you guys give me ideas on how to write the trigger to make sure the emails stop when the date has been entered?

thank you.

Chad
Hello- I am new to the sites feature and hastily created a domain name I cannot use (test1234.force.com). Is there any way at all to change this?
Here's the scenario:

When a user sets the Status of a Case to "Complete" and its previous Status is "New", I want it to be saved as "In Progress" first (for some trigger logic to run for "In Progress" Cases), before finally saving it as "Complete".  Is this possible?  Here's a snippet of code that I tried but it did not work:

if(originalStatus == 'New' || currentSR.OwnerId != Userinfo.getUserId()) {
             String holdOnToStatus = currentSR.Status;
             String holdOnToActionTaken = currentSR.ACTN_TAKEN_TXT__c;
            
             if(originalStatus == 'New') {
                 currentSR.Status = 'In Progress';
             }
             if(currentSR.OwnerId != Userinfo.getUserId()) {
                 currentSR.OwnerId = Userinfo.getUserId();
             }
             
             controller.save(); 
             //update currentSR;           // I also tried calling update instead of standard save but neither worked 
            
             currentSR.status = holdOnToStatus;
             currentSR.ACTN_TAKEN_TXT__c = holdOnToActionTaken;
}
controller.save(); 

Thanks!
I'm getting the "Too many SOQL queries" error on Line 17. Help me troubleshoot?

trigger InsideSalesAppointment on Task (after insert, after update) {

Map<Id,Date> LeadsToUpdate = new Map<Id,Date>();
List<User> InsideSalesUser = [SELECT Id FROM User where UserRoleId='00E30000001rctV'];
Set<Id> InsideSalesUserId = new set<Id>();
for (User u :InsideSalesUser) {
    InsideSalesUserId.add(u.Id);
    }


for (Task t: Trigger.new) {
    if(InsideSalesUserId.contains(t.OwnerID) && t.IsClosed == false && String.valueOf(t.WhoId).startsWith('00Q') && t.WhoId != NULL)
    
    LeadsToUpdate.put(t.WhoId, t.ActivityDate);
    }

List<Lead> LeadsAppointment = [SELECT Id FROM Lead where Id IN:LeadsToUpdate.keyset()];

if (LeadsToUpdate.keyset().size()>0){

for (Lead l: LeadsAppointment) {

    l.Next_Appointment_Date__c = LeadsToUpdate.get(l.id);
    }
    update LeadsAppointment;
}
}


Hi,

We are trying to make a callout to "https://support.breadwinnerhq.com/bwpayment/v1/accounts/00Db0000000b9t" from Salesforce. But, we are facing an exception:

System.CalloutException: java.security.cert.CertificateException: No subject alternative DNS name matching support.breadwinnerhq.com found.

The domain has a valid SSL certificate.

We have checked from SSL shopper: https://www.sslshopper.com/ssl-checker.html?submit=submit&hostname=support.breadwinnerhq.com (https://www.sslshopper.com/ssl-checker.html?submit=submit&hostname=support.breadwinnerhq.com)

But, still we are facing this issue.

We don't understand why is Salesforce not allowing us to make callouts to this domain when it has a valid SSL certificate and the browsers allow it.


Thanks,
Rupali
I have code similar to below

if(Schema.getGlobalDescribe().get('ChatterMessage') == null){
          chatterMessageEnabled = false;
} else {
          chatterMessasgeEnabled = true;
}

In one of the environment we have disabled Private Messaging so that this standard object is not accessible. When I execute above code snippet in developer console, I notice that the chatterMessageEnabled is set to false which is expected. 

However if this similar code is installed as part of managed package in the same environment, notice that chatterMessageEnabled is set to true which is unexpected and causing issues. Can any one help in overcoming this issue? 

Searching on Schema.getGlobalDescribe results that its behavior in managed package is always trickier.