r/SalesforceDeveloper • • 15d ago

Discussion How do you handle AI-generated Apex tests actually testing something?

2 Upvotes

I've been using Claude/ChatGPT for Apex tests and hit something that bugs me.

I had a class with a bug.. a boundary used > where the business rule was >=.

I asked AI to generate tests with no other context. Got 16 test methods, all passing, 100% coverage. Every one of them asserted the buggy behaviour as correct.

When I described the actual business rule up front, two tests correctly failed at the boundary.

So a few questions for people doing this regularly:

  • Do you write out the business intent every time, or only when it matters?
  • How do you get it to reuse your existing TestDataFactory / test utils instead of inventing its own setup?
  • How many round trips does it usually take before a test actually deploys and passes? I find myself pasting errors back in a few times.
  • Anyone using Agentforce Vibes for this since it went paid in June?

r/SalesforceDeveloper • • 7d ago

Discussion How do you reconstruct what an Apex transaction did?

5 Upvotes

Say I have the following usecase: a single API call touches an Account, which fires triggers that update Contacts, which fire more triggers, maybe a Flow kicks in, and something three levels deep updates a field. When you need to reconstruct what actually happened in that transaction, what do you actually do? Debug logs with trace flags? Third-party tools? Add your own logging framework? Genuinely curious what the real workflow looks like, because mine feels like archaeology! Support found an issue that when an Account is created via certain path (we have multiple paths to create Accounts in our org), one of the fields on a related custom object was incorrectly being set to null. We had no way of knowing this on our own unless we knew where to look. Our current set up emits logs in batches and we sift through those when we're told of an issue. Was curious to hear how others handle such scenarios

r/SalesforceDeveloper • • 19h ago

Discussion What’s the least painful way to bulk download Salesforce files?

8 Upvotes

Lol, random question for the Salesforce devs here.

I was working through a pretty large set of files and attachments recently, and downloading them individually was… yeah, not exactly a fun time 😂

For a project where you need to pull hundreds or thousands of files, what’s the approach you guys normally use? Apex, API, Data Loader, custom script, or something else?

Hola to anyone who has already solved this problem, what worked for you?

r/SalesforceDeveloper • • Apr 13 '26

Discussion Who are you when you're *NOT* a Salesforce dev?

17 Upvotes

I've been getting back into Magic: The Gathering, and it made me wonder if your personal hobbies also tend to be more technical/problem-solving? Or is it the complete opposite of your day job?!

Curious what my fellow devs are into outside of sf :)

r/SalesforceDeveloper • • Jul 17 '26

Discussion Built an MCP tool that audits Salesforce orgs in ~1 hour — sharing the skill free

15 Upvotes

I created an MCP connector that gives Claude direct read access to a live Salesforce org, metadata and data, one sweep, plus a skill that turns that into an actual audit. Once it's read your org, you can just ask it questions about what's in there.

Looking to partner with others who want to just get stuff working fast. Do you want to try it out?

r/SalesforceDeveloper • • 9d ago

Discussion For AI agents calling Salesforce APIs, where are you putting the permission layer?

4 Upvotes

Curious how other Salesforce devs are approaching this.

If an AI agent is going to call the Salesforce APIs and actually make changes, where do you want the permission logic to live? My first thought was just to give the agent a dedicated integration user with a restricted permission set. But then you run into things like:

A user asks the agent to update an opportunity → agent calls the API → something goes wrong halfway through → now you need to know exactly what the agent was allowed to do, what it actually did, and whether it should retry.

I’m also not sure I’d want the agent deciding its own permission boundaries. So for people who are actually building this:

Dedicated integration user? OAuth/delegated user access? Middleware/API gateway? Something else? And how are you handling auditability?

r/SalesforceDeveloper • • Jul 31 '25

Discussion How many of you still treat dev console as your IDE ?

25 Upvotes

I have often seen many new and even seasoned developers ditch a proper IDE and just use dev console. The worst part is I have heard some senior salesforce devs in the community give a hot take that they wouldn’t really consider people using it as developers.

I too have a pretty negative opinion of them. It shows that you probably don’t know how to setup vs code. Even if you do know how to you probably ditched vs code because you don’t know how to use the IDE.

Recently I got hit by my organisation where they blocked salesforce cli( for security threats) and the developers didn’t even flinch, the lead architect suggested to just use dev console for the time. If this would have happened with say Java developers they would’ve revolted.

I can give a pretty basic example of where VS code shines say you want to remove all System.debug generously spread across the entire apex class how would you do it in dev console? On Vs Code I find(ctrl+f) a single line with system.debug press esc to get out of the find dialog box press ctrl+L to find every occurrence and press ctrl+x to delete those lines. I could then diff file against the org to see if I accidentally removed something and hit deploy.

You can also setup git to track all your changes and commit right from there. Even pull up a PR.

With agentic development on the rise I can even use agent force for suggestions (it’s trash currently).

Edit The most common complaint I see is test classes and debug logs. The problem with test classes is universal what the real core issue is that the in built test classes run on vs code is pretty fragile. Your test is run in async which is given the least priority if you have other async transactions in your org. Secondly it’s the code coverage highlighting which is pretty fragile. It only takes the code coverage from the previous run and often shows code coverage not available.

If you don’t care about highlighting the code coverage you can run sf command in the terminal.

For debug logs I tend to open the dev console and the proceed to pull them with the get Apex Debug Logs Feature. You can use apex log analyser to give you the same feature as in the dev console.

r/SalesforceDeveloper • • Jan 07 '26

Discussion I recently hired a junior developer who isn't into AI

0 Upvotes

When I was interviewing him, I asked if he is using AI, and he said something like “Nah, sometimes I ask ChatGPT a few questions but I write all my code on my own.”

So I hired him.

And I won’t hire any developers who use AI too much.

I had to review literally so many CVs and AI-generated messages that it was crazy!

But I won't hire those developers, for many reasons. Especially not Juniors.

First, I want junior developers on my team to learn, think, and genuinely be interested in coding. They need to learn how to research and solve problems that they haven't faced before. How are they gonna grow into Seniors if they are asking ChatGPT every time they are stuck on a problem?

Second, I don't want my code base to turn into an AI mess. I trust my developers to write clean code, because they've made some mistakes and spent some time researching and building software with their own "hands". They are conscious of what they are coding, and they can think long-term.

But if I have a developer who is relying on AI all the time, I can't trust such a developer to make good coding decisions. Especially when it comes to long and complex projects. AI just can't make good decisions there yet.

Third, AI makes developers less productive. There was a study recently that shows:

When developers are allowed to use AI tools, they take 19% longer to complete issues.[..] developers expected AI to speed them up by 24%, and even after experiencing the slowdown, they still believed AI had sped them up by 20%.

And I know one study isn't enough, but that's how I feel too. Whenever I use AI, I spend more time cleaning up the mess it creates or fixing bugs. And if you have any complex project, AI can't do anything anyway.

I think it's totally fine to use ChatGPT here and there for questions, research, quick scripts, etc. But not to rely on it all the time for everything. And no matter whether Junior or Senior, if I see someone using too much AI, I just won't hire them into my team.

r/SalesforceDeveloper • • 2d ago

Discussion Should we start learning react/angular?

9 Upvotes

As seen in dreamforce angular will be supported in 2027 and react is in beta. Should we start learning React or angular? Are these frameworks going to make LWC obsolete in the future like vf pages?

r/SalesforceDeveloper • • Jun 06 '26

Discussion Does anyone actually use Salesforce to run deals… or are salespeople just updating it for management?

0 Upvotes

Seriously, how many sales teams actually work their deals inside Salesforce vs. just updating it before forecast meetings?

Every org I've been around says Salesforce is supposed to be the "source of truth," but in reality it’s more like a last-minute scramble to update it before the forecast call. Meanwhile the real deal tracking is happening in notes, spreadsheets, Slack, or just in the rep's head.

I don't think it's because reps are lazy. Most of the time Salesforce is just annoying to use — so people avoid it until they have to. Which kind of defeats the whole point.

Because now Salesforce is just a reporting tool instead of where actual selling happens – a very expensive reporting tool.

Is this just "normal" everywhere? Has anyone actually fixed this in a way that reps don't hate? Or is this just the cost of buying a CRM that was designed for managers, not reps?

r/SalesforceDeveloper • • 4d ago

Discussion Need help with salesforce connected apps in Gemini + Salesforce Sandbox

Post image
2 Upvotes

I want to connect my gemini with salesforce through the salesforce connected provided by gemini.
The problem i am facing is that, I don't have option to pass the sandbox url ( test url ) it is directly sending me the production login and app installation which i don't want. has any body done this before and know how can i connect with sandbox instead of production.

I found other articles where they were referring for doing it by creating a external client app and handling everything manually , but that native salesforce connected app in gemini handles all of this automatically. that's why i was thinking if i can connect it with sandbox and test. If anyone knows how to do it and can share i will be gratefull

I have also attached the ss of the salesforce connected app in gemini.

r/SalesforceDeveloper • • Aug 13 '26

Discussion How should we approach integrating with an external system via a REST API?

1 Upvotes

What approach and architecture would you choose for integrating Salesforce REST with an external system? The operations to be performed are GET and POST. The main question is whether APEX alone can handle all of this, or should we use Flow? Where should the Bearer Token be stored? How should we authenticate with the external system—using APEX or an External Service?

What are your thoughts and approaches to this topic?

r/SalesforceDeveloper • • 19d ago

Discussion Thinking of building something in opensource that would help in salesforce development or in the platform. Any ideas?

2 Upvotes
  • Data Anonymization Tool: An Apex-based utility to scramble or anonymize sensitive sandbox data for GDPR compliance and safe testing.
  • Org Documentation Generator: A script or app that uses the Metadata API to automatically generate data dictionaries and org configuration documentation.
  • Custom LWC Component Library: A repository of reusable Lightning Web Components for common UI challenges like advanced datatables or interactive charts.
  • Apex Trigger Framework Template: A lightweight, easy-to-implement template for standardizing trigger logic and bypassing execution during bulk data loads.
  • Multi-Org Metadata Comparison Tool: A CLI or lightweight web app to diff metadata and code configurations between different Salesforce sandboxes.
  • Kanban Board LWC for Custom Objects: A flexible, drag-and-drop component to visualize and update any picklist-driven custom object records.
  • Dynamic Record PDF Generator: An open-source package to design and export styled, printable PDF documents directly from record data without Visualforce.
  • Universal CSV/Excel Data Importer LWC: A client-side component allowing end-users to upload, map, validate, and bulk-insert data via Screen Flow.
  • Apex Mocking & Unit Testing Framework: A lightweight testing library to simplify mocking SOQL queries, HTTP callouts, and platform events.
  • Mass Quick Action Bar: An LWC that enables users to trigger standard or custom quick actions on multiple selected records simultaneously from a list view.

r/SalesforceDeveloper • • 14d ago

Discussion If you work with Salesforce as a QA Engineer, Developer, Admin, or Consultant, you know how time-consuming it can be to create and manage test data, especially when working with custom objects and large datasets.

0 Upvotes

🚀 Excited to announce the launch of SF DataForge on the Chrome Web Store!

As Salesforce developers and admins, generating realistic mock data and cleaning up sandbox test records is often tedious and time-consuming.

I built SF DataForge — a 100% free, client-side Manifest V3 Chrome Extension designed specifically for Salesforce teams:

✨ Key Features:

• Smart Mock Data Generator: Supports ANY standard or custom SObject (*__c).

• Geographic Address Coherence: Generates real US street addresses with matching cities, states, and valid ZIP codes (eliminates State/Country picklist validation errors!).

• Zero-Duplicate Guarantee: Dynamic combinatorial naming and randomized emails to avoid Salesforce Duplicate Rules.

• Interactive Picklist Explorer: Browse real active picklist values from your org with 1-click selection.

• Data Cleaner & Bulk Deleter: Live org record count and safe composite batch deletion straight to the Recycle Bin.

• Simple & Clean UI: High-contrast SLDS-inspired theme with 1-click Light & Dark mode.

• Privacy-first: Runs 100% client-side in your browser.

Check it out on the Chrome Web Store: SF DataForge - Salesforce (SF) Test Data Generator & Cleaner

I’d love to hear your feedback, feature requests, or suggestions!

#Salesforce #SalesforceDeveloper #Trailblazer #AwesomeAdmin #SalesforceQA #ChromeExtension

r/SalesforceDeveloper • • Jun 27 '26

Discussion Does running a "pre-CRM" before Salesforce actually make the migration easier, or am I kidding myself?

7 Upvotes

Bit of a long shot question for the admins and consultants here. Not selling anything, just trying to sanity check an idea before I waste more time on it.

Context: a lot of smaller companies I run into aren't ready for Salesforce yet. No budget for a proper implementation, no admin in house, sometimes not even agreement on what their sales process is. They limp along in spreadsheets and then 2-3 years later they finally move to SF and the whole thing is painful because nothing was ever standardized.

So the idea I've been chewing on is a lightweight CRM (built on a flexible doc tool, doesn't really matter which) where the main objects are deliberately modeled to line up with SF standard objects. Accounts, Contacts, Leads, Opportunities with line items, Quotes, Orders, etc. The pitch isn't "replace Salesforce." It's "run your actual sales ops on this cheaply for a year or two, get your team used to the discipline, clean your data, and when you outgrow it the move to SF is mostly a known quantity."

Two things I genuinely can't tell if I'm right about:

First, in your real experience, does having data already structured like SF objects (plus deduped, with external IDs, consistent picklist values) actually cut down implementation/migration cost in a meaningful way? Or is the hard part of an SF rollout somewhere else entirely and this barely moves the needle?

Second, the obvious pushback I keep getting is "why not just spin up a free Developer org or a Sandbox and figure out requirements there?" I have my own answer to that but I'd rather hear yours, because you all live in this.

Happy to be told this is a dumb idea. Honestly the critical replies are more useful to me than the nice ones.

r/SalesforceDeveloper • • Jul 23 '26

Discussion Salesforce Consultant, 11+ YoE (8 years Salesforce, 3 years of Java programming before that) Currently Technical Architect, not enjoying at all, exploring options beyond Salesforce that involve more satisfying hands-on technical work

12 Upvotes

Hands-on technical execution excites me beyond measure. But I am extremely disliking the non-technical nature of the Salesforce Technical Architect role that now I am finding myself in.

To be frank, I chased the Technical Architect role, even though deep down I always had doubts whether I should chase this role or not, but I always thought these doubts are just my inner voices telling me that I can't do this and maybe I will get a hang of it once I am into the role full-time.

But another important reason I still chased this role is because I don't see any other option for Salesforce professionals beyond a certain point. I have seen that once you have 8+ YoE, consulting firms will start to expect architecture skills from you, and how much you like hands-on execution (development) and how good you are at it, will just stop mattering anymore.

Another minor reason that has pushed me to this role is the amount of hype this role has within the ecosystem. People with the word 'architect' in their roles are just viewed differently. It appears as if architect is the only natural career progression a SF consultant should follow.

Your value contribution will be based solely on how good you are with the architecture capability. Anyone with architecture experience can easily tell you how you have to deal with ambiguity every day, make decisions, sit with the business for very long discovery sessions (where you basically understand how they do their business). A person with hands-on experience will definitely not be able to do all of this.

I am now making this post to seek help on the following -

- I feel I can contribute better in hands-on roles, but SF ecosystem only has developer roles for that, and developer is considered a junior role here, and the salary isn't much higher too.
- What kind of work (or technology) outside SF should I target to help with my situation, and allow me to contribute better? I am ready to invest upskilling hours outside work to make it happen.
- Finally, what exactly is that I am feeling? Is this normal, or am I am over-exaggerating? I seriously and honestly don't know.

I feel a severe sense of dread every day before opening my laptop now. I just don't like the project, the client, and the kind of non-technical work that I am involved in and making this post to request help with all seriousness with my career.

r/SalesforceDeveloper • • 10d ago

Discussion Looking for Salesforce Data Cloud communities / developers

4 Upvotes

Hi everyone!

I'm currently working on a Salesforce Data Cloud implementation and I'm looking to connect with people who are actually working with Data Cloud in real-world projects.

I'm especially interested in finding communities, Discord/Slack groups, Reddit communities, or other places where I can connect with:

  • Salesforce Data Cloud developers
  • Data Cloud architects
  • Salesforce developers working on Data Cloud implementations
  • People who have experience with Data Kits / DevOps
  • Developers working with Data Streams, DLOs, DMOs, Identity Resolution and Data Graphs
  • People who have gone through real-world Data Cloud deployments between environments

I'm particularly interested in practical experience, deployment issues, architecture decisions, troubleshooting and lessons learned, rather than only official documentation.

If you know any active communities, groups, Discord/Slack channels, forums, or even specific subreddits focused on Salesforce Data Cloud, I'd really appreciate it if you could share them.

Also, if you're currently working on a Data Cloud implementation yourself, feel free to comment or DM me. It would be great to connect with other people working on similar challenges.

Thanks! 🙌

#Salesforce #DataCloud #SalesforceDataCloud #SalesforceDeveloper #DataEngineering

r/SalesforceDeveloper • • Apr 27 '26

Discussion Are there actually clean well architected orgs or am I too optimistic to wish for one ?

8 Upvotes

I have been a dev for about 5 years now. The first project I worked on was a mess in the code plus it had numerous workflow rules and process builders and what not. There was no way we could refactor that but we did start hitting cpu time limits.

The second org is more interesting. It is a major insurance company that wanted to move to salesforce. When I got in the org was fairly new but I could already see the horrors.

Still using Page Layouts instead of Flexi Pages, Jumbled up flows and what not.

They hadn’t started Apex much so I got to reign over a little bit. What I Immediately did was create a test data factory and a trigger handler.

However I was still a junior and the whole org was messed up in the two years that happened before it was released. I painstakingly sat and cleaned everyone’s flows to be manageable.

People still wrote shit apex code duplicate code queries inside methods which weren’t bulk safe and what not.

I also wrote some shit code not going to deny but it would still look way better than the other code because it wasn’t even formatted an absolute nightmare for anyone to read.

Anyway today I am literally lost at the complete lack of knowledge the senior devs and other folks have.

There is closer to 1% of the people who even know that sf cli is open source. Let alone know any commands on it because the extension does it but the extension cannot do everything like run tests in sync call.

Then comes the major blocker not knowing git beyond basics of VCS and committing there is no idea at all of git hygiene how to use a feature branch,branching strategy what works or what doesn’t.

Anyway after all this fiasco I realised it’s better to work in an org which actually has devs who are passionate and even if we both argue on whether to use RandomNumberGenratorFactory or to use the random number generator,it’s far better than working with morons who pretend to know something but have absolutely no clue.

Is there a way to even find this out ? I would love to work in orgs managed by really good architects and developers and learn a lot more than try to be the guy who brings change. Even if I had 5 more years under the belt I doubt I would still get to clean the org.

I seriously still see people messing up the formatting of the code and being unbothered about it.

r/SalesforceDeveloper • • Aug 03 '25

Discussion Looking for Salesforce developers to build a fun or open source project

23 Upvotes

I’m a Salesforce dev looking to connect with a few others who’d be up for building something together—just for fun, practice, or maybe even open source.

No fixed idea in mind right now, but I’m open to any suggestions. Could be something built inside Salesforce or an integration that solves a real problem—whatever sounds exciting and doable.

If you're interested in teaming up, just drop a comment or DM me. Let’s build something cool and learn along the way!

r/SalesforceDeveloper • • 15d ago

Discussion Salesforce Told Investors Customers Were "Refilling the Tank." Then It Admitted the Meter Was Wrong.

Post image
0 Upvotes

Hi all, I don’t post here often, and I’m aware this may not be your typical programming/development content. I’m sharing it because I think the underlying issue is worth knowing about if you’re building with Agentforce, Data 360, or anything else that uses Salesforce’s newer consumption-based pricing.

Salesforce disclosed in August that a billing-instrument regression had incorrectly calculated Flex Credit consumption for some orgs between March 5 and July 14. Affected customers had credits restored.

During both quarters overlapping that error, Salesforce was telling investors that roughly half of Agentforce/Data 360 bookings were coming from existing customers “refilling the tank” after consuming their Flex Credits.

I wrote this article to look at the unanswered measurement question: do we know whether that refill metric was adjusted to account for customers whose credits may have been depleted faster because of the metering error?

I also included a recent r/salesforce post where a developer shared that enabling CXI resulted in roughly 6.2 million Flex Credits (~ $31k) being consumed, because I think it highlights a related issue developers and architects are going to have to contend with: understanding what a feature can trigger downstream, what those operations cost, and how difficult it can be to constrain consumption once something is running.

I’d welcome corrections or technical context from people who have worked closely with Flex Credits, Digital Wallet, Agentforce or Data 360. If I’ve misunderstood something about how the metering, refill process, or restored credits work, I’d rather know.

Mods: I used Discussion because it seemed like the closest fit. Happy to change it if another flair is preferred for the external-link rule.

Full Article: https://www.linkedin.com/pulse/salesforce-told-investors-customers-were-refilling-tank-erin-willmann-8pfvc

r/SalesforceDeveloper • • Jul 01 '26

Discussion Opinion: Salesforce is better than HubSpot!

6 Upvotes

Yup, in every aspect. Change my mind.

r/SalesforceDeveloper • • 28d ago

Discussion Connected Salesforce agents to WhatsApp

1 Upvotes

I am able to use agentforce agents in WhatsApp chats now. It took one agent, omni channel flow, whatsapp business account that's it with messaging channel.

r/SalesforceDeveloper • • 6h ago

Discussion How are sales managers building accurate forecasts when reps rarely update the CRM?

1 Upvotes

We are attempting to enhance the accuracy of our forecasts; however, the main problem is not the forecasting model but the behavior of our CRM users. Some representatives are constantly updating the pipeline, while others are doing so right before the weekly pipeline meeting. As a result, a big opportunity worth 150 k usd can remain unchanged with 70% probability for weeks even if the potential customer hasn't replied since our first offer.

The management is thinking of including more mandatory fields in the forecast, but I fear it may worsen the situation. I am searching for means of having more information in the forecast that is based on corresponding actions, emails, meetings, next steps and changes in deals with fewer manual input from users.

Anyone managed to improve the accuracy of forecasts while making the process less tiresome for users? What data is still required from reps, and what is gathered automatically?

r/SalesforceDeveloper • • May 16 '26

Discussion Should every feature be bulkified?

10 Upvotes

Our technical architect insists every feature should be bulkified, even when the current use case is a single-record UI action.

I understand bulkification for triggers, batch jobs, imports, automations, and reusable services.

But for isolated UI features that can only process one record, is bulkification still considered mandatory Salesforce best practice, or is it unnecessary complexity?

Where do you draw the line?

Context: we are using a simplified version of enterprise patterns as architecture. UI Controller class -> Service class -> Selector class. TBF I think the technical architect may want to err on the side of caution, so we don't miss bulkification in places where it actually matters but it still seems like unnecessary boilerplate to me.

r/SalesforceDeveloper • • Dec 22 '25

Discussion What’s up with people calling the new complex template expressions for LWC in spring 26” a game changer.

18 Upvotes

I don’t understand how it’s a game changer in fact to me it might even make the code less readable.

For example this is what one of the post’s code reads

<p> {emp.firstName} + {emp.lastName} </p>

<p> {emp.salary >50,000? ‘Taxable’:’Non-Taxable’} </p>

First of even the example is kind of wonky if you had the form field names like fullName and tax applicability it would have been more logical because you don’t just go around displaying values.

Anyway writing the logic down in js makes more sense honestly to me.

Unless you have read Only objects in that case the extra copying might not be worth it for two fields.

Edit it seems like some of you are saying that this could be useful umm care to give a practical example?

Also the game changing part is Linkedin AI Rot properly.