Skip to main content

#Trailhead447 discutindo

I'm investigating an unexpected heap behavior when executing Apex code through Execute Anonymous.

In my original implementation, I repeatedly concatenated strings inside a loop:

String content = (String)largeConstraintRule.get('content');

content += rule.Content__c;

largeConstraintRule.put('content', content);

This resulted in the following exception:

System.LimitException: Apex heap size too large: 11134880

 

 

I then changed the implementation to collect string fragments in List<String>, merge them using String.join(parts, ''), and call parts.clear() afterward. 

 

With the modified implementation, Limits.getHeapSize() reached 17,274,637 bytes (approximately 16.47 MiB) during execution, but the code completed successfully. The final heap size was only 9,186,563 bytes (approximately 8.76 MiB)

. 

 

My questions:

  1. Why did the modified code complete successfully despite reporting a heap size of approximately 17.27 MB?
  2. Can garbage collection or temporary object allocations explain this behavior?
  3. How exactly does Apex enforce heap limits when Limits.getHeapSize() reports a value above the configured limit?

Any insights or official documentation explaining this behavior would be greatly appreciated.

Thank you! 

 

#Salesforce Developer

2 respostas
  1. Hoje, 06:44

    @Usman Khan  Thank you, but this post hasn't resolved my confusion. Why does using += cause a heap limit exception, while using String.join() does not? I even deployed the code using String.join() to my org, and it ran successfully. This is truly baffling!

0/9000

Hi!, I'm dealing with the trailhead https://trailhead.salesforce.com/content/learn/modules/agentforce-agent-testing/set-up-testing-criteria?trail_id=become-an-agentblazer-legend-2026

and get stuck with the enable of the agentforce test center. I created the org, linked it and turned einstein and Agentforce (Default) but when i search for the Test Center i'm not able to see it.  

 

 

Im getting errores with the Agentforce Test Center

 

 

 

#Trailhead Challenges  #Trailhead  #Agentforce

3 respostas
  1. Hoje, 06:40

    Hi, as mentioned in the module to work with the legacy Agentforce Testing Center in Setup, these permissions are needed: 

    Manage AI Agents AND the required permissions for your agent type AND System Admin profile 

    OR 

    Customize Application AND System Admin profile

0/9000
2 respostas
  1. Hoje, 04:21

    Hello @Prasanth Sanapala

     

    Make sure you have a Global Action that has its default name: SendEmail. 

     

    There are three more things to keep in mind for this to work: 

    1. Ensure Setup > Deliverability > Access to Send Email org wide pref is set to "All Emails" (this is OFF by default in Sandbox orgs, and also on trial orgs which haven't verified the user email address) 

    2. Ensure the user has the Send Email user perm (which also adds the Edit Tasks user perm) 

    3. Ensure that the Send Email Action is added to Lightning Actions in the Page Layout. 

    Please note these three are requirements of the feature, not part of the Bug. 

    https://help.salesforce.com/s/articleView?id=000387906&type=1

0/9000

Hi! How do I connect new Help Agent to already created HelpPortal? I can't use the same portal name for new agent and can't find the Help Portal itself. 

 

#Trailhead Challenges  #Trailhead

2 respostas
  1. 28 de out., 19:02

    Share trailhead module link. Generally, the agent will use the chat widget provided by Experience cloud site.

0/9000

Does anyone  know how to run a test Message Session in the sandbox? I am not seeing any object for Message Sessions when searching the Quick find. 

 

If I am correct, when a message session has been started it should create a Case. Is this logic correct? 

 

#Trailhead

3 respostas
  1. 28 de out., 17:31

    Hello Dhanush, 

     

    Thank you for the reply. I really do appreciate it. Been super busy, so I will test it some time today or tomorrow.

0/9000

Pardot Engagement History give me opens and clicks, but I cannot find a way to also get 'sent' data into CRM analytics, so that I can build a complete funnel and interrogate performance retrospectively against segments in my data. Is there a way to bring in this data? 

 

#Trailhead  #CRM Analytics

1 resposta
  1. 28 de out., 16:21

    Hi Neil, have you checked the List Email and Email Send data in MCAE? Engagement History mainly covers interactions, so sent data may need to be pulled separately.

    I'd look at exporting it through the Pardot API and bringing it into CRM Analytics as a separate dataset. You could then join it with your engagement data to build the full funnel. 

0/9000

Good afternoon everyone, hope you are doing well. 

 

I would like to ask a few questions regarding sandboxes in MARKETING CLOUD NEXT, which came up as I started on a new project. To give you some general context, this client basically wants to do all the development in the sandbox, and once everything is validated and tested, deploy it to production—which is totally fine.

 

 

However, here are my questions: 

 

1 - Regarding WhatsApp: Can I perform the setup configuration, warming, and testing all within the sandbox? My concern is whether I will need to replicate this entire process in production later on. If there is an ideal scenario or best practice, I would like to understand how to proceed with this step. 

 

2 - Regarding Email: Similar to the WhatsApp situation, my main question is about the domain/subdomain in the sandbox. When doing all this setup, do I need to perform the IP/domain warming normally? Is it necessary to create a domain/subdomain to work in the sandbox as well, and then repeat the same step for production? Or is the process different for a sandbox? 

 

In short, these are my main questions, but just to reiterate: this client wants everything to be developed and tested in the sandbox, and we will only deploy to production once everything is validated.

Because of this, I have these questions so I can understand the best way to move forward. 

 

Thank you. 

 

#Trailhead  #Salesforce Developer  #Salesforce Admin  #Salesforce  #TrailblazerCommunity  #Marketing Cloud

4 respostas
  1. 28 de out., 15:03

    @dhanush gunda thank you so much for your help! You have no idea how much you've helped me and pointed me in the right direction for these tasks. I promise this will be my last question! haha

     

    Regarding the subdomain: Considering that my client already has a subdomain configured in MCE. In this case, I will follow the approach you suggested—a test subdomain for the sandbox. Since I already have one in MCE, I will just need to share it with the PROD Environment in MC Next and proceed with the tasks, right? Because according to the Salesforce help documentation, if the client already has a usable domain in MCE, I can share it with Next without needing to warm it up, correct?

     

    I promise this is my last question, haha! Thank you so much!

0/9000

I am doing the Admin Beginner > Lightening Experience Customization Module.  I am on Create Energy Audit Records.  The account lookup is not locating any of the test accounts in the module: Burlington Textiles Corp of America, University of Arizona etc., even though they exist as accounts in the playground. 

 

#Trailhead Challenges  #Trailhead

5 respostas
  1. Ontem 04:32

    Hello @Amy Ricci

     

    This issue occurs because the Salesforce global search index hasn't "indexed" or registered the pre-loaded test accounts inside your newly created Energy Audit lookup field yet. In Salesforce, lookup fields often rely on your Recently Viewed cache to populate instant search dropdowns. 

     

    To fix this and get the lookup to immediately locate Burlington Textiles Corp of America or University of Arizona, use the following steps: 

    1. Click the App Launcher (the 9-dot grid icon in the top left corner), type in Accounts, and select it. 

    2. By default, it might be on Recently Viewed. Click the list view dropdown menu at the top left of the list and change the filter to All Accounts. 

    3. Find Burlington Textiles Corp of America (or whichever account you need) in the list and click on its name to open the record page. 

    4. Opening the account adds it straight to your user's Recently Viewed history. 

    5. Return to the Energy Audits tab and click New. Type "Burlington" into the Account lookup field—it will now instantly appear in the results

0/9000

I am trying to create a Devops Data kit in my partial sandbox and trying to deploy it in Uat sandbox using change sets. The Data kit creation was successful and I also deployed it successfully in my Uat but when I try to deploy the Data kit I got the below error.”The salesforce CRM is no longer authenticated. Verify and re authenticate the connection then deploy the Data stream.I did the verify CRM connection multiple times and there are no issues around that but not sure why this is happening. 

 

  

 

#Data360

3 respostas
  1. Ontem 01:18

    Hi @Kavyasri Dacharla

     

     

    I’ve seen this error come up even when the CRM connection verifies fine. It usually isn’t really about authentication. Here’s what I’d check in the UAT org: 

    • Connector permission set access. The “Data Cloud Salesforce Connector” permission set in UAT needs read access to every object and field in the data stream. If a field from your partial sandbox is missing or has no FLS in UAT, the deploy fails with this misleading auth error. This is the most common cause I’ve seen.
    • The deploying user. Deploy the data stream as a Data Cloud Admin. Ideally use the same user who set up the CRM connection in UAT.
    • The connection itself. In Data Cloud Setup > Salesforce CRM, try a full disconnect and reconnect of the home org rather than just verifying it. Then redeploy from Data Kits.
    • Deploy order. After the change set lands, deploy the data stream from the data kit inside Data Cloud. Pick the UAT CRM connection when it prompts you.

     

    If it still fails after all that, raise a support case with the data kit name and the error. 

     

0/9000

it's the second time I've retaken this and it keeps saying this "we can't find the Newsletter prompt"...is it some backend issue? how can i fix this?...I've tried the other methods and still nothing...I've also waited for playground to expire. still the same issue..

 

#Trailhead Challenges

 

 

#Trailhead  #Salesforce Developer  #Salesforce Admin  #Agentforce

4 respostas
  1. 28 de out., 08:49

    Hi MOHAMMAD, a quick follow-up ahead of the Oct 30 read-only date. Did my answer get you unstuck? If it worked, please mark it as the best answer so others can find it. Let me know if anything is still not working.

0/9000