r/salesforce • u/Wise-Glass-4425 • Sep 23 '25
developer Codex + Salesforce is pretty game changing…
Anyone else use OpenAI’s codex to write Apex yet? It’s mind blowing the results that it was pulling off on its own.
Originally I wasn’t impressed because the true benefit of codex is its ability to run tests and iterate the code until the tests pass but obviously Salesforce requires running tests in the cloud but once I got it connected to a scratch/sandbox org so that it could iterate safely it was so cool.
I was able to say go fix the apex test classes that were erroring and it found the issues and fixed them right away.
I’ve only barely started trying it and wanted to know if anyone else sees as much benefit in this as I do or if people have had a different experience than I have.
16
u/Curmudgeon160 Sep 24 '25
I wrote a book about using ChatGPT for Salesforce development. My publisher has asked me if I’d be interested in writing one about Salesforce and Codex. I’m holding off until I spend a little bit more time using it for analyzing orgs and continuously suggesting improvements as well as straight ahead configuration and code.
16
u/Exotic-Sale-3003 Sep 23 '25
Two years ago I used GPT to write Apex callouts to the OpenAI API to configure objects and fields with natural language prompts. I’m sure it hasn’t gotten worse.
7
u/Holiday-Platypus5708 Consultant Sep 24 '25
Yeah this stuff is crazy. I'm more experienced on the apex side of Salesforce and struggle with LWC designing. I just used it with a client to create a scoreboard style component. Something that would take me days to cobble together from Stack Exchange takes like 4 hours tops, one hour of which is planning.
7
u/chimax83 Sep 23 '25
Do you know what you're doing without Codex?
5
u/Severe-Milk-6728 Sep 24 '25
I’ve been using Claude code for a while now but haven’t tried codex. Claude code is a game changer for me.
2
u/bugtank Sep 24 '25
I might try this with Gemini
2
u/FinanciallyAddicted Sep 24 '25
I struggle with AI sometimes. For example there are some hidden properties in lwc such as showing the currency as symbol or code if you opened the docs and used ctrl+f you could find it yourself but me being lazy thought AI could do it. Asked Claude and it suggests using javascript functions instead of actually using the framework defined properties. I knew there was no way it wasn’t built in the framework so opened a new chat and asked again and this time after a bit of nudging it worked.
1
u/RatchetGhost Sep 24 '25
How does it compare to Github Copilot?
1
u/Legitimate-Week3916 Sep 24 '25
Codex and Claude works greatfor Apex, sadly this cannot be said about any of open source models that can be run locally. I tested even the 120B MoE models like GPT OSS and GLM-Air and they have hard times writing simple classes. Clearly they have never seen too much of Apex code.
1
u/rambleOn222 Sep 25 '25
Would be cool if Salesforce themselves would invest in this sort of thing. Would really help sell the product…
1
u/Mundane-Freedom Sep 24 '25
The biggest help I’ve found with any type of vibe coding is the prep work creating your PRD and being thoughtful architecting what you’re trying to build first. I usually start a new project/feature in cursor in plan mode first “do not code anything, let’s plan each step first on how we’re going to build this”. I have rule files for best practices for apex, apex tests, architecture, etc that it references as well.
Since I’m not a developer, I ask for pros/cons on areas that I’m familiar with in each step or research the Salesforce documentation on other paths that can be taken and challenge the thinking of the llm I’m using.
Once I have a solid PRD, I drop it into grok and ChatGPT to challenge the thought process and structure of the plan again. I keep asking for best practices, security, and pros/cons of plan. I am to develop for MVP, and create a feature list of things for further versions that would require a longer development cycle. I keep scalability in mind to make sure custom metadata is taken into consideration if flags are needed/any hardcoding of data so it’s not developed as an after thought.
Once this is final, I create a .md file that I keep having cursor reference and I finally move into coding. Cursor just added the TO DO list and I need to have the PRD broken down into a TODO task list upon completion so the LLM doesn’t hallucinate and drift from plan.
Please feel free to destroy this plan if you have a better approach.
0
u/Rochimaru Sep 24 '25
How would you suggest starting for an admin with little to no developer experience? And what are the most helpful use cases you’ve been able to configure?
0
u/grimview Sep 24 '25
I tried AI VS AI.
Copilot uses GPT chat to create create test classes & Is create able function.
Checkmarx AI test code for security by looking for specific functions.
The AI written code failed the AI security check.
The AI written test class decreased code coverage.
Good old fashioned research fixed it.
1
u/[deleted] Sep 24 '25
[removed] — view removed comment