Skip to main content

#Contacts2 discussing

Hello community: I have a question regarding when you have only one business unit. How do you handle API event tests that might be involved in a Java build? For example, how would a password reset process work? Do you test and delete contacts? Do you use a dedicated test journey? 

Thanks 

 

 

#Marketing Cloud  #MarketingCloudNext  #Email Marketing  #Journey Builder  #Contacts

2 answers
  1. May 20, 10:05 PM

    Thanks @john wick Thank you very much. By "deleting contacts" I meant leaving an automation. Regarding trips, is it common to have one test and one real trip, or does it depend on the case? For api, the attribute can be used, but if it's later deleted, I understand it's not necessary. I didn't understand the part about deletion.

0/9000

Hi

 

I have a list of contacts who registered for a few webinars, my requirement is to get the number of contacts registered by Webinar considering only the first occurrence, irrespective of other webinars registered.

So if a contact registers for 3 webinars, he has to appear only under the first webinar he registered and not under others.

 

The output should look something like this:

 

Webinar#ContactsWebinar12Webinar2 5Webinar31

 

Attached a sample file.

2 answers
  1. Mar 27, 2019, 10:15 PM
    Hi Naveen

     

    I used your calculation with a slight change, since i wanted the calculation not based on Webinar name but Webinar date,

     

    if {FIXED [email]: MIN([date of webinar])} = [data of webinar] THEN [email] ELSE NULL end

0/9000

In NPSP, we mark members of a household as deceased, but many spouses/partners remain. I find that the informal and formal greetings still include the name of the deceased   , and the deceased member is still included in the count of household members.   I could swear that this didn't used to be the case. And according to the documentation on that field it is supposed to be removed.  But this isn't happening.  Is there some setting I'm missing? Some switch to throw? Our org is a senior college. Got lotsa widows and widowers out there.

 

#NPSP Related  #NPSP Import Tool  #Contacts

1 answer
0/9000

hello team,

 

My org is trying to mass delete contact records which are now inactive. While reading up on best practices, I found some contradictory information.

 

A salesforce help article says : Note that Accounts, entitlements, and opportunities that are associated with the contact aren’t deleted.

 

The mass record feature under Set up it says : This screen allows you to delete a list of Contacts from salesforce.com. The following data will also be deleted:

  • Contact Notes
  • All Opportunities associated with the Contacts
  • All Activities associated with the Contacts

Do opportunities associated with contacts get deleted when you delete a contact?

 

Thanks

AJ #Contacts

2 answers
  1. Mar 6, 2025, 12:53 AM

    I tried using Mass Delete Records today for a single contact, and it did not delete the Opportunity. 

     

    In my setup, Contact is a field in the Opportunity object, with a Lookup(Contact) relationship (Data Type) to the Opportunity object.

0/9000

Why do I see under system information to the right side of the created by section log informing another user's message stating modified by the contacts already imported?

 

#Contacts

0/9000

What be the best way to view a contact and see a chronological timeline of all cases and activities?

(I can get a related list of Cases but no description) and separately the Activity list.

Users want one chrono list of

- Cases with Descriptions

- All case notes, comments, emails

 

Thinking every time a case is created, copy Case link, Subject, Description, Stage to an activity?

Any other options or methods people use?

3rd party apps?

Thanks

 

#Case  #Service Cloud  #Cases  #Contacts  #Customer Service  #360 Degree View

1 answer
  1. Feb 28, 2024, 10:08 PM

    It should be possible by creating a custom related list LWC component which shows the required data. You will have to involve a Salesforce developer to achieve this functionality. 

0/9000

Hi Everyone,

 

I created a record trigger flow to do: when an agent link a contact to messaging session, that contact should be link to case as well

I have this following configuration for my flow

 

Start Record Trigger Flow

  • Object: Messaging Session
  • Configure Trigger: A record is updated
  • Set Entry Conditions : EndUserContactId Is Null False
  • When to Run the Flow for Updated Records : Only when a record is updated to meet the condition requirements
  • Optimize the Flow for: Action and Related Record

Update Record

  • How to Find Records to Update and Set Their Values: Update records related to the messaging session record that triggered the flow
  • Set Field Values for the Case Records : ContactId-> $Record > Contact ID

#Flow #Record-Triggered #Case #Messaging Session #Contacts

3 answers
  1. Eric Burté (DEVOTEAM) Forum Ambassador
    Nov 2, 2023, 9:34 AM
    Hello @Ariel Gencianeo

    what is the issue you have with your flow ? I do not see it in your flow description, but have you done a Get Records to retrieve the case(s) you want to update (one or many) ?

    Eric

0/9000

We have a Contact Roles Related List on a page layout, showing the First Name, Last Name, Contact Role, and the Line of Business. For some reason, the "First Name:" label isn't showing before the contact first name. I checked the related list on the page layout editor, and everything seems fine there. First Name label not showing in Related List for Contact RoleAircraft Contact Roles 2.png

I'm not sure where else to check or how to fix it. Any advice would be appreciated. Thank you!

 

#Salesforce #Pagelayouts #Related List #Contacts #Salesforce Admin #Saleforce Administrator

4 answers
0/9000

I've written an Apex class with methods that parse data out of a CSV file, create account and contact lists with custom fields used as external IDs, and upsert that data using the custom fields as the comparison for duplicates. However, Apex thinks the data in the contact list contains duplicates. I have confirmed in the file itself and via debug code (comparing against a set) that it does not, and I can see when I write debug code to only add the contact to the list if it is not already in the list that Apex thinks every record is a duplicate. 

 

I've written code to ensure and confirm that the list is empty before I start adding to it, I've edited the match rules so they only match on the external ID, and I've uninstalled Dupe Eliminator and Duplicate Check (installed by my predecessor) to be sure they aren't creating restrictions I can't access. Also, I've tried to check Apex triggers, but they are managed and can't be viewed/edited. We do have quite a few other packages/apps installed. Could these be the issue? Could it be a scope of the variable issue? Does anyone have any suggestions on what else might be the issue? 

 

I am including my code below with the caveat that it is pretty messy right now with all my debug code, comments, and variables for other methods in place. Below that code is a screenshot of the debug log starting at the beginning where you can see the first test for the contact existing in the list results in TRUE, before any other contact has been added to the list, and that there is no debug output for the code outputting

 

 any contacts already in the list before I start adding to it. Finally, I am also including a screenshot of our installed packages.

public class mkfa_ImportLegacyData {

//Create an affiliation, contact, and account list for those being manipulated by methods.

public static List<npe5__Affiliation__c> affiliationList = new List<npe5__Affiliation__c>();

public static List<Contact> contactList = new List<Contact>();

public static List<Account> accountList = new List<Account>();

//Create string lists for holding all data & 1 row from document

public static List<String> dataRecs = new List<String>();

public static List<String> fieldValues = new List<String>();

public static List<List<String>> parsedData = new List<List<String>>();

public static Boolean proceedFlag = true;

//Create a contact,account, affiliation, and IDs

public static Contact tempContact = new Contact();

public static VOID parseFileRecs(string docName){

//Get the file

final ContentVersion doc = [SELECT VersionData FROM ContentVersion WHERE Title = :docName AND IsLatest = true];

//******CSV file must be in UTF-8 format******

String bodyString = doc.VersionData.toString();

//Split the content into records by new line character

dataRecs = bodyString.split('\n');

//Debug code

//system.debug('Body of the document to import:'+bodyString);

//Iterate through the records in the file to create a list of recs, sans the header, each of which is a list of fields

for(Integer i=1;i<dataRecs.size();i++){

fieldValues = dataRecs[i].split(',');

parsedData.add(fieldValues);

}

}

public static VOID parseContactFields(String fileName){

//Make sure the contact list to upsert is empty.

contactList.clear();

/*Debug code to be sure contactList is empty. */

for (Contact thisContact : contactList){

System.debug(thisContact);

}

//Parse the data from the file

parseFileRecs(fileName);

proceedFlag = true;

List<Account> contactAcctList = new List<Account>();

List<String> AccountNumList = new List<String>();

String tempVal;

//Set to test for duplicates

//Set<Contact> externalIDs = new Set<Contact>();

//Retrieve all the account numbers from the CSV file

for(Integer j=0;j<parsedData.size();j++){

AccountNumList.add(parsedData[j][1]);

//Debug code

//system.debug('Acct # added: '+AccountNumList[j]);

}

//Query the db for all accounts matching the list of account numbers

contactAcctList = [SELECT Id, mkfa_AccountNum__c FROM Account WHERE mkfa_AccountNum__c IN :AccountNumList];

//Iterate through the records in the file

for(Integer i=0;i<parsedData.size();i++){

//Create contact from this row of data

tempContact.mkfa_External_ID__c = parsedData[i][2];

//Checking for duplicates

/*

if(externalIDs.contains(tempContact)){

system.debug('This ID is a duplicate: ' + tempContact);

}

else{

externalIDs.add(tempContact);

}

*/

//debug Code

//system.debug(i+': Contact External ID: '+ tempContact.mkfa_External_ID__c);

tempContact.FirstName = parsedData[i][4];

//debug code

//system.debug('Contact First Name: '+ tempContact.FirstName);

tempContact.LastName = parsedData[i][5];

//debug code

//system.debug('Contact Last Name: '+ tempContact.LastName);

//Get the account # from the file, test it against the list of accounts we queried earlier in SoQL

tempVal = parsedData[i][1];

for(Integer k=0;k<contactAcctList.size() && proceedFlag==true;k++){

if(contactAcctList[k].mkfa_AccountNum__c==tempVal){

tempContact.AccountId = contactAcctList[k].Id;

proceedFlag = False;

}

}

//Add the contact to the contact list

if(!contactList.contains(tempContact)){

contactList.add(tempContact);

system.debug('Contact added: ' + tempContact);

}

else{

system.debug('Contact is dup: ' + tempContact);

}

//debug code

//system.debug('Added contact: '+tempContact);

proceedFlag = true;

}

//Testing for duplicates. Makes sure the set used to look for dups is the same size as the list of contacts.

/* if(contactList.size()==externalIDs.size()){

system.debug('No problems with dups. Proceed.');

}

else{

system.debug('Hold up. There are dups the SS did not find.');

}

*/

//Try to upsert the contacts *****Use external ID

Database.UpsertResult[] upsertResults = Database.upsert(contactList,Contact.mkfa_External_ID__c,true);

/* try{

upsert contactList Contact.fields.mkfa_External_ID__c;

} catch(DmlException e) {

System.debug('The upsert failed. That is OK. Return to the maze and take this message to guide you: ' +

e.getMessage());

}

*/

}

}

Apex Thinks Data Set with Unique Records Has Duplicates

 

SF_InstalledPkgs01_2023Aug31.jpg

 

SF_InstalledPkgs02_2023Aug31.jpg

 

#Apex #Duplicates #Contacts #Matching Rules

8 answers
  1. Sep 22, 2023, 9:28 PM

    @Elizabeth Lester

    Thanks for the offer! This endeavor has moved to low priority, but if you do find it piques your interest and you want to spend any time helping, I'd appreciate the help to getting it to run correctly.

     

    I realize I can clean up some of the code with options such as break instead of using flags, and using local variables where I don't need continuity between methods, and I will take care of that when I swing back around to this.  Also, I've removed code I had been using for debugging but was not using on the last run. Finally, I've only included the methods pertinent to this issue, but I left all the public variables in place, so there may be some that seem unnecessary.

     

    public class mkfa_ImportLegacyData {

    //Create an affiliation, contact, and account list for those being manipulated by methods.

    public List<npe5__Affiliation__c> affiliationList = new List<npe5__Affiliation__c>();

    public List<Contact> contactList = new List<Contact>();

    public List<Account> accountList = new List<Account>();

    //Create string lists for holding all data & 1 row from document

    public List<String> dataRecs = new List<String>();

    public List<String> fieldValues = new List<String>();

    public List<List<String>> parsedData = new List<List<String>>();

    public Boolean proceedFlag = true;

    //Create a contact,account, affiliation, and IDs

    public Account tempAcct = new Account();

    public npe5__Affiliation__c tempAffiliation = new npe5__Affiliation__c();

    public ID affiliateAcctID;

    //Method to get data from a file object

    //***Clean quotation marks out of names in CSV file first.****

    public VOID parseFileRecs(string docName){

    //Get the file

    final ContentVersion doc = [SELECT VersionData FROM ContentVersion WHERE Title = :docName AND IsLatest = true];

    //******CSV file must be in UTF-8 format******

    String bodyString = doc.VersionData.toString();

    //Split the content into records by new line character

    dataRecs = bodyString.split('\n');

    //Debug code

    //system.debug('Body of the document to import:'+bodyString);

    //Iterate through the records in the file to create a list of recs, sans the header, each of which is a list of fields

    for(Integer i=1;i<dataRecs.size();i++){

    fieldValues = dataRecs[i].split(',');

    parsedData.add(fieldValues);

    }

    }

    /*Method to parse the contact info from the CSV file, search SQL for accounts matching eT's Account number,

    * create a list of those accounts, search that list for each contact to find that contact's corresponding account,

    * and populate the contact list accordingly*/

    public VOID upsertContacts(String fileName){

    //Make sure the contact list to upsert is empty.

    contactList.clear();

    /*Debug code to be sure contactList is empty. */

    for (Contact thisContact : contactList){

    System.debug(thisContact);

    }

    //Parse the data from the file

    parseFileRecs(fileName);

    proceedFlag = true;

    List<Account> contactAcctList = new List<Account>();

    List<String> AccountNumList = new List<String>();

    String tempVal;

    //Retrieve all the account numbers from the CSV file

    for(Integer j=0;j<parsedData.size();j++){

    AccountNumList.add(parsedData[j][1]);

    }

    //Query the db for all accounts matching the list of account numbers

    contactAcctList = [SELECT Id, mkfa_AccountNum__c FROM Account

    WHERE mkfa_AccountNum__c IN :AccountNumList

    ORDER BY mkfa_AccountNum__c ASC];

    //Iterate through the records in the file

    for(Integer i=0;i<parsedData.size();i++){

    Contact tempContact = new Contact();

    //Create contact from this row of data

    tempContact.mkfa_External_ID__c = parsedData[i][2];

    tempContact.FirstName = parsedData[i][4];

    tempContact.LastName = parsedData[i][5];

    //Get the account # from the file, test it against the list of accounts we queried earlier in SoQL

    tempVal = parsedData[i][1];

    for(Integer k=0;k<contactAcctList.size() && proceedFlag==true;k++){

    if(contactAcctList[k].mkfa_AccountNum__c==tempVal){

    tempContact.AccountId = contactAcctList[k].Id;

    proceedFlag = False;

    }

    }

    //Add the contact to the contact list

    if(!contactList.contains(tempContact)){

    contactList.add(tempContact);

    system.debug('Contact added: ' + tempContact + 'ID: ' + tempContact.Id);

    }

    else{

    system.debug('Contact is dup: ' + tempContact + 'ID: ' + tempContact.Id);

    }

    proceedFlag = true;

    }

    //Try to upsert the contacts *****Use external ID

    Database.UpsertResult[] upsertResults = Database.upsert(contactList,Contact.mkfa_External_ID__c,true);

    }

    }

0/9000

Whenever we create a filter on Contact as part of a Journey the count does not change. It continues to show entire Contact count instead of filtered count. Any idea how to resolve this as it causes lack of confidence in Campaign Managers. 

1 answer
  1. May 21, 2023, 10:11 AM

    Hi @Chandrajeet Kanchan

     

    I understand that you're experiencing an issue with the Contact filter not working as expected in your Journey on ORG. I'll try my best to help you resolve this issue.

     

    When the Contact filter is applied in a Journey, it should update the count to reflect the filtered contacts rather than showing the entire contact count. If you're encountering a situation where the count does not change, there are a few things you can check to troubleshoot the problem:

     

    1. Verify your filter criteria: Double-check the filter criteria you have set for the Contact filter. Ensure that the criteria accurately define the contacts you want to include or exclude from the Journey. If the criteria are not correctly defined, it may result in an incorrect count.
    2. Confirm filter logic: Ensure that the filter logic is properly set up. If you have multiple conditions in your filter, make sure you have specified the correct logical operators (AND, OR) to accurately represent your intended filter criteria.
    3. Test with sample contacts: Try testing the filter with a smaller subset of contacts to see if the count updates correctly. This can help identify if the issue is specific to certain contacts or if it's a broader problem.
    4. Review Journey settings: Take a look at the Journey settings and confirm that there are no conflicting configurations or settings that could interfere with the Contact filter. Pay attention to any interaction settings or entry criteria that may impact the filter's behavior.

    Remember, resolving this issue will help restore confidence in Campaign Managers and ensure that your Journey accurately reflects the filtered count of contacts.

     

    I hope you find the above information helpful. If it does, please mark it as Best Answer to help others too.

     

    Thanks & Regards,

    @Asim Ansari 

0/9000