• Evelyn Fayad
  • NEWBIE
  • 10 Points
  • Member since 2016

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

I am creating an unmanaged package that includes three process builders, two of which are launching a visual flow. 

When I try to download the package in my developer account, I am getting this error for two of the process builders: 

myRule_1_A1 (Action Call) - We can't find an action with the name and action type that you specified. 

I have read almost everything online relating to this issue - I have deleted inactive versions of both the process builders and the visual flows, I have ensured that all fields are included in the package. Not sure what else to do, so here I am! 

Any ideas? Thank you in advance! 

 
Hi everyone, 

I've been playing around with flows and process builders but I think I need to write a trigger for this one. I am trying to display an activity field (customfield__c) on the Contact and on the Account IF it is the most recent activity. 

However, sometimes the customfield__c will be blank. I only want to look at the most recent activity WITH customfield__c not null. 

Has anyone come across this issue before?

 
Hi Community! 

I have a process builder that launches a flow. It's main goal is to check a boolean field on the task IF it is the latest task AND a field on the task is not blank. So, if it is the most recent task, and the field is not blank, it will be checked. It seems to be working well. 

So now... my main goal is to take the field (the one that I mentioned that isn't supposed to be blank) on the latest task, and display it on the Account AND on the Contact. 

So now SFDC knows which task is the most recent. All I need to do is display a field from that task on the Account & Contact. 

I created another process builder and visual flow, but I'm getting errors in my inbox. 

I am happy to provide screenshots. Has anyone come across this workflow before? 

Thank you in advance! 
I have a trigger that is creating a ton of errors. 

Active Contact Trigger - This trigger counts the number of active contacts (contacts that have been touched by the account owner in the last 14 days) and displays the total number on the Account. 
  • ERRORS THAT I AM GETTING FROM THIS TRIGGER: 
    • ActiveContact: execution of AfterUpdate caused by: System.DmlException: Update failed.
    • ActiveContact: System.LimitException: ApexCPU time limit exceeded
Here is the trigger itself: 
trigger ActiveContact on Contact (after insert, after update) {
    Contact[] cons;
    if (Trigger.isDelete) 
        cons = Trigger.old;
    else
        cons = Trigger.new;
    // get list of accounts
    Set<ID> acctIds = new Set<ID>();
    for (Contact con : cons) {
            acctIds.add(con.AccountId);
    }
    Map<ID, Contact> contactsForAccounts = new Map<ID, Contact>([select Id
                                                            ,AccountId
                                                            from Contact
                                                            where AccountId in :acctIds
                                                            AND Active_Contacts__c = 1 ]);
    
    Map<ID, Account> acctsToUpdate = new Map<ID, Account>([select Id
                                                                 ,Number_of_Active_Contacts__c
                                                                  from Account
                                                                  where Id in :acctIds]);
                                                                 
    for (Account acct : acctsToUpdate.values()) {
        Set<ID> conIds = new Set<ID>();
        for (Contact con : contactsForAccounts.values()) {
            if (con.AccountId == acct.Id)
                conIds.add(con.Id);
        }
        if (acct.Number_of_Active_Contacts__c != conIds.size())
            acct.Number_of_Active_Contacts__c = conIds.size();
    }
    update acctsToUpdate.values();
}


Can anyone give insight into why I am getting these errors? 
 
Hi everyone, 

I'm trying to create a custom field that populates with the name of whomever had the last activity on the lead. I'm currently trying to do this using a trigger.

This is the Apex Trigger that I have written:

trigger lastactassigned on task(after insert) {
  map<id,lead> leads = new map<id,lead>();
  for(task record:trigger.new) {
    if(record.ownerid.getsobjecttype()==user.sobjecttype) {
      if(record.whoid!=null&&record.whoid.getsobjecttype()==lead.sobjecttype) {
        leads.put(record.whoid,new lead(id=record.whoid,Last_Act_Assigned_To_Test__c=record.ownerid));
      }
    }
  }
  update leads.values();
}


AND this is the Apex Class that I have written to test the trigger:

@isTest 
public class lastactassignedTest1 
{
    static testMethod void testMethod1() 
    {
        User user = new User();
        
        Lead lead = new Lead();
        lead.LastName ='Test';
        lead.FirstName ='New';
        // Add all required field
        insert lead;
        
        Task task = new Task();
        task.WhoId = user.Id;
        task.Subject = 'Other';
        task.Status = 'Not Started';
        task.Description = 'New  Work';
        insert task;
    }
}

So as of right now, both of them save without any problems; however, when I hit 'run test' on the Apex Class, it fails. 

I'm thinking that there may be something wrong with the trigger, but I am not completely sure. I would love some input!

Thank you,
Evelyn 
Hi Community! 

I have a process builder that launches a flow. It's main goal is to check a boolean field on the task IF it is the latest task AND a field on the task is not blank. So, if it is the most recent task, and the field is not blank, it will be checked. It seems to be working well. 

So now... my main goal is to take the field (the one that I mentioned that isn't supposed to be blank) on the latest task, and display it on the Account AND on the Contact. 

So now SFDC knows which task is the most recent. All I need to do is display a field from that task on the Account & Contact. 

I created another process builder and visual flow, but I'm getting errors in my inbox. 

I am happy to provide screenshots. Has anyone come across this workflow before? 

Thank you in advance! 
I have a trigger that is creating a ton of errors. 

Active Contact Trigger - This trigger counts the number of active contacts (contacts that have been touched by the account owner in the last 14 days) and displays the total number on the Account. 
  • ERRORS THAT I AM GETTING FROM THIS TRIGGER: 
    • ActiveContact: execution of AfterUpdate caused by: System.DmlException: Update failed.
    • ActiveContact: System.LimitException: ApexCPU time limit exceeded
Here is the trigger itself: 
trigger ActiveContact on Contact (after insert, after update) {
    Contact[] cons;
    if (Trigger.isDelete) 
        cons = Trigger.old;
    else
        cons = Trigger.new;
    // get list of accounts
    Set<ID> acctIds = new Set<ID>();
    for (Contact con : cons) {
            acctIds.add(con.AccountId);
    }
    Map<ID, Contact> contactsForAccounts = new Map<ID, Contact>([select Id
                                                            ,AccountId
                                                            from Contact
                                                            where AccountId in :acctIds
                                                            AND Active_Contacts__c = 1 ]);
    
    Map<ID, Account> acctsToUpdate = new Map<ID, Account>([select Id
                                                                 ,Number_of_Active_Contacts__c
                                                                  from Account
                                                                  where Id in :acctIds]);
                                                                 
    for (Account acct : acctsToUpdate.values()) {
        Set<ID> conIds = new Set<ID>();
        for (Contact con : contactsForAccounts.values()) {
            if (con.AccountId == acct.Id)
                conIds.add(con.Id);
        }
        if (acct.Number_of_Active_Contacts__c != conIds.size())
            acct.Number_of_Active_Contacts__c = conIds.size();
    }
    update acctsToUpdate.values();
}


Can anyone give insight into why I am getting these errors? 
 
I need to write a validation rule for if other is selected on a multi select picklist then it will be directed to a text field.
 
Hi everyone, 

I'm trying to create a custom field that populates with the name of whomever had the last activity on the lead. I'm currently trying to do this using a trigger.

This is the Apex Trigger that I have written:

trigger lastactassigned on task(after insert) {
  map<id,lead> leads = new map<id,lead>();
  for(task record:trigger.new) {
    if(record.ownerid.getsobjecttype()==user.sobjecttype) {
      if(record.whoid!=null&&record.whoid.getsobjecttype()==lead.sobjecttype) {
        leads.put(record.whoid,new lead(id=record.whoid,Last_Act_Assigned_To_Test__c=record.ownerid));
      }
    }
  }
  update leads.values();
}


AND this is the Apex Class that I have written to test the trigger:

@isTest 
public class lastactassignedTest1 
{
    static testMethod void testMethod1() 
    {
        User user = new User();
        
        Lead lead = new Lead();
        lead.LastName ='Test';
        lead.FirstName ='New';
        // Add all required field
        insert lead;
        
        Task task = new Task();
        task.WhoId = user.Id;
        task.Subject = 'Other';
        task.Status = 'Not Started';
        task.Description = 'New  Work';
        insert task;
    }
}

So as of right now, both of them save without any problems; however, when I hit 'run test' on the Apex Class, it fails. 

I'm thinking that there may be something wrong with the trigger, but I am not completely sure. I would love some input!

Thank you,
Evelyn