Many Pies

Many Pies

Thursday, October 30, 2025

Vibe coding with Gemini - and a childhood dream fulfilled

A red triangle with several coloured blocks inside it

As a followup to my post on vibe coding in Salesforce, here's what happened with Gemini.

First let me take you back to my ZX80/81/Spectrum programming days. I created a little game where you woul drop blocks into a 2d pyramid shape. If a block fell outside that shape then it was Game Over. The graphics on those machines were addressable in 8 pixel blocks so it wasn't very realistic. I thought it would be a lot better if the blocks had proper physics. I didn't have the words for it at the time, but what I needed to do was create a physics engine. That seemed like a full time job, and programming was just a hobby in those days.

I gave Gemini this prompt to create the game I'd imagined in my childhood:

Create a browser game where there's a block at the top which regularly moves from left to right. When you press the space bar that block should drop another blog down to the ground below. The blocks should have proper physics and collision and tumble over each other.

It understood what I meant pretty well. I didn't give it a Game Over condition, but it invented one of its own - if the blocks filled up to the top of the screen then that was it. As it was, that was pretty much a good starting point. I spent a few iterations trying to get it to not trigger game over as soon as a block fell (because it was at the top of the screen).

At this point my impression switched from "this is amazing - look how complete a thing it can generate with a few words" to "why doesn't it understand what I'm saying?". 

It did work eventually though, so I moved onto Phase 2 - the pyramid shape. Again it took a few iterations before I could get the shape I wanted - at first it did it upside down. Once I got the shape I wanted I added a game over/high score screen at the end and that was my minimum viable product. 

It's got a cheery manner, as AIs seem to these days. 

Make it so that 1 in every 5 blocks is really bouncy Gemini: That sounds like a fun way to increase the challenge! Introducing a bouncy block every fifth drop will definitely keep you on your toes.  I've updated the game logic so that 1 in every 5 blocks has a high restitution (bounciness) and is colored cyan so you can easily identify it.

Here it is. Can you beat my high score of 26? Be warned - it's got a really annoying soundtrack and collision noises, but you can mute it.


Monday, October 20, 2025

My first impressions of Salesforce Vibe Coding

The face of a bear with "Let's vibe" underneath

 I spotted a new icon on the Salesforce setup menu, so I decided to give it a go. It's a full web-based VS code IDE.


As it happened I had a specific Lightning Web Component that needed to be created, so I prompted with that. I have to say, it's very impressive. It doesn't just generate a load of code, it knows about how the whole deployment process works. It has a plan mode, so you can clarify things before you put it into "act" mode. It asked me clarification questions

Before finalising the plan I need a few specifics to ensure the data model and security model are correct

It asked me nine questions in all, so I answered one, expecting it to then say "what about the second question" but it went through the whole cycle again. So I gave it several answers in one go.

The process of identifying the target org it should deploy to wasn't obvious or straightforward, even though it was thinking out loud about how to get that information. I didn't know how to tell it though.

Get username. Intelligently determines the username  or alias for Salesforce operations

In the end I told it "set username to name@company.com" and then it put that into configuration as expected. When I later tried to get it to use a sandbox it default to login.salesforce.com

I got an error "provider context length exceeded". When I asked for help with solving it, I just got the same error. I gave up for the day, came back the next day, and it was OK. I guess it just needed a nice cup of tea and a sit down.

It asks permission nicely before it does things or creates files, so you can follow along, rather than just waiting until it's finished and you have to dig around to find out what it's actually done.

Bear in mind, I didn't look at any of the available help information, I was just ploughing on. 

I got as far as deploying the component, which then failed because of lack of org wide test coverage. It then offered me four different options. I went with running only tests related to the change. The deployment then failed because of 0% coverage on the test class. It suggested that it could write some code to cover that. I wouldn't have minded if it did that without asking, but I went ahead and asked nicely anyway. It churned away, trying deployments, adding code to set default values. All the while it was thinking out loud:

I see the issue now. The problem is that we're trying to create a User with a ContactId, but the org requires that users who are associated with contacts must be portal users. Let me modify the test class to handle this by creating a regular user without associating it to a contact, or by using a different approach for the test setup.

 In the end, after several iterations, it managed to deploy the component:

The tests now pass successfully with 100% pass rate. The test class properly deploys to the target org and executes without errors, providing confidence that the GauAllocationsExplorerController functionality works as expected in the target environment.  **


Conclusions

How you view this depends on what your knowledge is.

If you don't really know about Apex programming then there's probably too much that you need to know to get anywhere (e.g. test coverage, local vs org tests).

If, like me, you've dabbled a bit, you know about deployment and Salesforce dx, then it will get you a long way towards getting something that basically works. You can then actually read the help information and increase your skills.

If you do this sort of thing all the time I imagine that it will take a lot of the drudge work of setting up new projects and creating outline code which does most of what you want. You can then go in and use your l33t skillz to finish the code off.


Wednesday, May 14, 2025

Why I went for a #clicksnotcode Salesforce certification



When I started working for my recent Platform App Builder certification (have I mentioned that recently?) I initially was heading towards the Platform Developer cert, which includes writing Apex code. We don't have much Apex code in our current org, and have only modified it a couple of times in minor ways. So I wouldn't be using the code writing skills that I gained in order to get it, and they'd get rusty. Given my years of experience writing code in other languages (and the Apex I wrote in 2017 for our switch from Raiser's Edge to Salesforce) I think I could pick it up if required.

It strikes me though, that the whole development process with, say, a Flow is very much like the process if you're writing Apex. So typically you:

  1. Talk to the people who want the enhancement or bug fix (let's assume it's a fix)
  2. Work out how to fix it
  3. Work out how to test that fix
  4. Fix it
  5. Test it
  6. User acceptance testing
  7. Documentation/training
  8. Release
So step 4 is different between Flow writing and Apex coding, but everything else is very similar. Have I over-simplified everything, or is there something substantially different to coding compared to creating a Flow?

Wednesday, February 26, 2025

My experience of Salesforce Certification

 

Certified Platform App Builder badge

I've recently completed my first Salesforce certification - Platform App Builder and I thought I'd share some of my experience. I can't tell you much about the exam itself or the Salesforce hit squad will be round my house.

I'd recommend Focus on Force with their study guides and practice exams. It took me about 5 months doing an hour or so a week to work through the guides and the exams before I felt ready.

I'd recommend this video by Roy Moore or this article on test taking tips to help with exam technique. When it comes to the question of doing it at home or at a test centre, I chose the test centre because a) I didn't have to faff around with proving I wasn't cheating and b) an hour's bus journey felt like a good way of getting in the zone.

The Platform App Builder certification is a mixture of admin stuff and flows and app configuration. There's no Apex because #clicksnotcode. 

If you haven't done a certification yet, is there anything you'd like to know?

Monday, July 01, 2024

Applying Diátaxis to a specific project

Diátaxis is a really interesting approach to technical documentation. It's summarised well in this paragraph and diagram from the website.

"Diátaxis identifies four distinct needs, and four corresponding forms of documentation - tutorialshow-to guidestechnical reference and explanation. It places them in a systematic relationship, and proposes that documentation should itself be organised around the structures of those needs."


I recommend digging through the site a bit before you carry on. Don't worry, I'll wait.


Glad you made it back.

I've been thinking of applying it to our existing technical documentation but never known where to start really. However an opportunity came along to apply it to a specific need.

The need: URLs for campaigns

We want to run campaign across print and digital, which direct people to pages on our website. We want to track how people respond to those campaigns, including on Salesforce where the information about people, signups and donations ends up. The knowledge about how to create URLs on and for our website, specifying Salesforce campaigns, and tracking results through Google Analytics is spread among various people. We had a meeting planned to share knowledge and ahead of time I wrote a document capturing my knowledge. I'm not going into the details of the information, as that's specific to this problem, but rather the process.

Here are the headings I used in that document:
  • Tutorials
  • How-to guides
    • Creating redirects in Wordpress
    • Tracking campaigns for web forms
    • Tracking campaign segments for web forms
    • Tracking social referrals in Google Analytics
  • Explanation
    • Redirects
    • The stuff after the question mark in a URL
  • Reference
    • Web forms in use and default campaigns
As you can see there is nothing at the second level for Tutorials, as at the moment I can't think of what a tutorial would cover. However I may come up with something after the meeting. It would be something useful to someone who knows nothing about the subject.

I may put more in this post after the meeting, but I thought this worked example of applying Diátaxis would be useful.

Friday, May 31, 2024

I was suspended on Twitter for no apparent reason

I try to avoid moaning too much on Twitter, but I've been suspended, so I'm going to moan about Twitter here. A few days ago I got a message that I'd been suspended. The last thing I tweeted was to retweet this picture:


It's not so straightforward though. As well as telling me I was suspended it also said I could subscribe. Sometimes I can see my old tweets, sometimes I can't. Sometimes I can see people I follow, even though it says I am following no-one, sometimes not.

What could I have done? I have several theories:

  • I liked a post I shouldn't have. As I can't get at my likes I can't check this.
  • My bio ("I ride tandem...") somehow breaks the rules.
  • I mentioned my mastodon id.
  • I called it Twitter and not X.
I've tried asking for a review, but as soon as I fill in the form I get a reply seconds later saying that they're not going to re-instate me. I do have a second twitter account that I set up, so I can still use that. It shows that it's probably worth creating a second account just in case you get banned in future.

Wednesday, May 01, 2024

Preventing duplicates from FormAssembly in Salesforce

Just a quick one.

When using FormAssembly (FA) with Salesforce that if you had a duplicate rule set to alert, then that would cause an error message to appear on the form. FA would treat this as a failure and not proceed. 

I submitted a suggestion to them that they treat duplicate alerts as warnings and not display them to the user, but I couldn't get them to understand what I meant.

So we have to handle duplicates after the fact, with a daily check, using a Google sheet that we wrote that looks up email addresses.