• Preeti Shetty
  • NEWBIE
  • 35 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 6
    Replies
I need to copy a field to the Task Object from its related contact.The Contact field "Activity Conversion Days" is a number field which gets updated based on a workflow rule. I want to copy dat field to task. I have created a number field in thr Task object with the same name. I tried creating a Process but I am getting errors. Can someone please help me with this. Also this is the first time I am using Process Builder and Flows. I am attaching a screenshot of the Process and Flow I have created.

User-added imageUser-added imageUser-added imageUser-added image
I have a custom Object with field "date/time of call" I want another number field to populate based on the time in this field irrespective of the date. For eg - Date / time of Call is 26/6/2016 8.00 AM it should populate 1 for 9 am - 2 10am - 3 .... 5 pm - 10 and so on Attached below for your reference -
User-added image

So if the Date/Time field is 26/5/2016 4.30 PM , Time of Day field should return 9.
I have a custom Object called "Novanet" with lookup fields "Contact" and "Account ". Can you help me with a trigger which will Update the Account from the Contact attached.
Our organisation is using Novanet VoIP. We want to integrate this with our Salesforce. We have created a object Novanet related to Accounts and contacts with the following fields - 
Novanet Name
Date/Time of call
Call Duration
Account
Contact
Owner
We are currently using data loader to feed novanet call data into Salesforce. Can someone help me create a url which will directly create a record on Salesforce when calls are made from Novanet.

Thanks.

 
Hi All,

In contacts I have two custom text fields called Secondary Source and opportunity Source. When I add the contact to a campaign I want the secondary source to be populated to the name of the campaign and Opportunity Source to be populated to the field campaign type (which is picklist field). Everytime I add the contact to a new campaign the source field should get updated. Is this possible??
Hi,

Is there anyway to include anyfield cahnge in an email template. In Cases when a user updates any field (not a specific field) an email alert should be sent wherein the email template should specify which field has changed. There are many fields in cases, so the email template should specify only the one which has been changed or edited.

Please let me know how can we do this.
Hi All ,

I am getting the following error while deploying a trigger
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ActivityTrigger: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object Class.ActivityTriggerHandler.getContactIds: line 17, column 1 Class.ActivityTriggerHandler.updateCallCount: line 7, column 1 Trigger.ActivityTrigger: line 3, column 1: []
Stack Trace: Class.TestUpdateAccountEngScore.myUnitTest: line 61, column 1

This my trigger handler -
public class ActivityTriggerHandler {
    private final String SUB_CATEGORY_CALL = 'Call';
    private final String SUB_CATEGORY_UPDATE = 'Update';
    private final String CONTACT_API = 'Contact';
    
    public void updateCallCount(List<Task> taskList) {
        Set<Id> contactIdSet = getContactIds(taskList);
        List<Contact> contactList = [SELECT Call_Count__c FROM Contact WHERE Id IN :contactIdSet];
        updateContacts(contactList);
    }
    
    private Set<Id> getContactIds(List<Task> taskList) {
        Set<Id> contactIdSet = new Set<Id>();
        for(Task t : taskList) {
            if(t.Sub_Category__c == SUB_CATEGORY_CALL | t.Sub_Category__c == SUB_CATEGORY_UPDATE) {
                Id whoId = t.WhoId;
                if(whoId.getSObjectType().getDescribe().getName() == CONTACT_API)
                    contactIdSet.add(whoId);
            }
        }
        return contactIdSet;
    }
    
    private void updateContacts(List<Contact> contactList) {
        for(Contact con : contactList) {
            if(con.Call_Count__c == NULL || con.Call_Count__c == 0)
                con.Call_Count__c = 1;
            else if(con.Call_Count__c >= 1)
                con.Call_Count__c = con.Call_Count__c + 1;
        }
        update contactList;
    }
}
and this is my trigger
trigger ActivityTrigger on Task (after insert, after update) {
    ActivityTriggerHandler handler = new ActivityTriggerHandler();
    handler.updateCallCount(Trigger.New);
}
Please help me resolve this.


 
I have a field called "Call_Count__c" which is a number field in Contact. I want that when some one logs a call and if the Subject Category is "Call" or "Update" the Call Count field should increase by 1. for eg if value in call count field is 3 it should become 1. Please help me with a trigger for this.
Hi,

In my organisation there are around 150 salesforce users. Some ids are group ids i.e. a team of 4 - 5 members using the same id for eg crm@zycus.com. How would the members using group ids access salesforce? Also after the implementation of SSO will I have to change the passwords of all users individually? What are the steps after the implementation of Single Sign On?
I have a field called "Call_Count__c" which is a number field in Contact. I want that when some one logs a call and if the Subject Category is "Call" or "Update" the Call Count field should increase by 1. for eg if value in call count field is 3 it should become 1. Please help me with a trigger for this.
I need to copy a field to the Task Object from its related contact.The Contact field "Activity Conversion Days" is a number field which gets updated based on a workflow rule. I want to copy dat field to task. I have created a number field in thr Task object with the same name. I tried creating a Process but I am getting errors. Can someone please help me with this. Also this is the first time I am using Process Builder and Flows. I am attaching a screenshot of the Process and Flow I have created.

User-added imageUser-added imageUser-added imageUser-added image
Hi All,

In contacts I have two custom text fields called Secondary Source and opportunity Source. When I add the contact to a campaign I want the secondary source to be populated to the name of the campaign and Opportunity Source to be populated to the field campaign type (which is picklist field). Everytime I add the contact to a new campaign the source field should get updated. Is this possible??
Hi All ,

I am getting the following error while deploying a trigger
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, ActivityTrigger: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object Class.ActivityTriggerHandler.getContactIds: line 17, column 1 Class.ActivityTriggerHandler.updateCallCount: line 7, column 1 Trigger.ActivityTrigger: line 3, column 1: []
Stack Trace: Class.TestUpdateAccountEngScore.myUnitTest: line 61, column 1

This my trigger handler -
public class ActivityTriggerHandler {
    private final String SUB_CATEGORY_CALL = 'Call';
    private final String SUB_CATEGORY_UPDATE = 'Update';
    private final String CONTACT_API = 'Contact';
    
    public void updateCallCount(List<Task> taskList) {
        Set<Id> contactIdSet = getContactIds(taskList);
        List<Contact> contactList = [SELECT Call_Count__c FROM Contact WHERE Id IN :contactIdSet];
        updateContacts(contactList);
    }
    
    private Set<Id> getContactIds(List<Task> taskList) {
        Set<Id> contactIdSet = new Set<Id>();
        for(Task t : taskList) {
            if(t.Sub_Category__c == SUB_CATEGORY_CALL | t.Sub_Category__c == SUB_CATEGORY_UPDATE) {
                Id whoId = t.WhoId;
                if(whoId.getSObjectType().getDescribe().getName() == CONTACT_API)
                    contactIdSet.add(whoId);
            }
        }
        return contactIdSet;
    }
    
    private void updateContacts(List<Contact> contactList) {
        for(Contact con : contactList) {
            if(con.Call_Count__c == NULL || con.Call_Count__c == 0)
                con.Call_Count__c = 1;
            else if(con.Call_Count__c >= 1)
                con.Call_Count__c = con.Call_Count__c + 1;
        }
        update contactList;
    }
}
and this is my trigger
trigger ActivityTrigger on Task (after insert, after update) {
    ActivityTriggerHandler handler = new ActivityTriggerHandler();
    handler.updateCallCount(Trigger.New);
}
Please help me resolve this.


 
I have a field called "Call_Count__c" which is a number field in Contact. I want that when some one logs a call and if the Subject Category is "Call" or "Update" the Call Count field should increase by 1. for eg if value in call count field is 3 it should become 1. Please help me with a trigger for this.