3

Probably user error :( but here goes.

I have a sandbox that has very recently been upgraded to Spring '21 (prerelease). I see the funky bear with the funky heart; I can go to dev console and look at the api dropdown list and see the V51 is now in the list. I'm thinking it is Spring '21.

I am itching to go play with Salesforce Functions, so I need to upgrade the sfdx cli and plugins yes? I do this : sfdx plugins:install salesforcedx@pre-release and get this : Installing plugin salesforcedx... installed v50.1.1 and this command : sfdx plugins --core shows list (among other things ) : salesforcedx 50.1.1 (pre-release)

Errr uhmmm. is that the prerelease version that corresponds to the Spring '21 release? I'm guessing not.

Have I totally failed the test by doing something totally wrong here? Where the plot actually thickens even further, is if I forget my sfdx problems for a bit, I simply go to the dev console (and pretending that I have created a function I could call) try and compile this bit of code (directly for the apex developer reference)

functions.Function accountFunction = functions.Function.get('AccountFunction');
functions.FunctionInvocation invocation = accountFunction.invoke('{ "accountName" : "Acct", 
"contactName" : "MyContact", "opportunityName" : "Oppty" }');
String jsonResponse = invocation.getResponse();

I get compile error Type is not visible: functions.Function

Please don't tell me the function AccountFunction is not defined. I know that :) And yes, I set the API version to 51 when saving the code...

Hmmm.. Yep, I've totally failed the test :( Please can someone save me ?

Thanks Peter.

2 Answers 2

1

I recently got an invite to the Functions pilot. Without going into specifics, I don't think you will be able to bootstrap yourself into a position where it will work with Spring '21 without being in the official pilot.

Yes, you can see some signs of it in exposed metadata, such as the Apex methods to invoke it. But there are more steps that need to be followed to get it to work end to end.

1
  • Thanks Daniel, I will perhaps ask our Salesforce rep what those specifics are then :) We certainly weren't involved in the pilot, so as you suggest, that is perhaps the missing link. I was under the impression that 'pre-release' however means us developer dudes would have access to functionality that's coming in the upcoming release. No where does it say that Salesforce functions (to be released as a beta in Spring '21) needs additional setup work (or that we had to be involved in the pilot), at least none that I can find :( I'll just wait I guess..... thanks mate. Commented Jan 12, 2021 at 0:10
0

Make sure to use api version 53 or greater with the Apex class invoking the function

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .