function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alo sen 12alo sen 12 

Automate Post-Workshop Tasks with Invocable Apex

I am in the last action where the process builder calls the invocable apex class. When i look for the class it appears with the LabelName
 'Give a Thanks Badge' and the lookups do not show up on the Giver Id and Receiver Id fields. Can someone tell me what am I doing wrong?
User-added image
If i put the apex class name as is shown in the trail it still does not find the Giver Id and Receiver Id values. My apex code has an active status.
User-added image
Thank you.
Best Answer chosen by alo sen 12
Blanche AngleaBlanche Anglea
Change the Type for Giver Id and Reference Id from ID to Reference and see if that clears your error.

All Answers

Matt NataliMatt Natali
I am running into the exact same issue. Any advice on this problem will be much appreciated. 
Thanks!
Blanche AngleaBlanche Anglea
Change the Type for Giver Id and Reference Id from ID to Reference and see if that clears your error.
This was selected as the best answer
Matt NataliMatt Natali
That makes complete sense. Thanks very much for steering in the right direction. 
alo sen 12alo sen 12
Thank you Blanche. That's what it was. The instruction clearly said so and i still missed it. 
ArunBalaji KArunBalaji K
I cant save my apex class itself Can anyone help me to solve this prob.

Invalidtype WorkThanks
ishant jainishant jain
I am geeting below error....please help me to complete this task...
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 7017F000000QMEQQA4; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3017F000000IWAK. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []
Alo SenAlo Sen
Ishat, is the flow active?
Sam Friedman 9Sam Friedman 9
As far as being unable to save the Apex class because of the WorkThanks error, I had the same issue, and I'm not exactly sure what I did to resolve it, but I did compile all of my apex classes in setup and switched to classic and I was then able to save it properly with no errors.
Pablo Ledesma 8Pablo Ledesma 8
I cant save my apex class itself Can anyone help me to solve this prob.

User-added image
Sreenivas VSreenivas V
Hello All,
    I am in the last section of this module, written the Apex class with Invocable Method and Variables without any errors. But when I change the Campaign details of Type to Dev Class and Status equals to Completed, I am getting the below error message. Please help me to complete this module.

triggerflow error

Regards
Sreenivvas Venkatesh
Rodrigo Dorador 6Rodrigo Dorador 6
I also need help with the last step. I do not understand why I get the following error message: 

Error Occurred: An Apex error occurred: System.QueryException: List has no rows for assignment to SObject Error Occurred: An Apex error occurred: System.QueryException: List has no rows for assignment to SObject
DeveloperSudDeveloperSud
Hi ,
Any one got the solution ???
Shuang Stoppe 2Shuang Stoppe 2
Hi,

I am in the Process Builder portion. It requies an Apex Class, which the Trailhead does not specify. But I only have some irrelevant options and can't find "Give a Badge". I can't get to Apex Variable fields until I specify the right Apex Class. Anyone knows what I am doing wrong?

User-added image
Justin NorvellJustin Norvell
@ishant jain
I had the same error and was able to resolve by creating a Thanks badge
Ranil Goonesekera 5Ranil Goonesekera 5
I get the following message when I try to test the process.  Any ideas on what I am doing wrong?  Thanks!

We can't save this record because the “Completed Class Sessions” process failed. Give your Salesforce admin these details. <b>An unhandled fault has occurred in this flow</b> An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Error ID: 676449539-99570 (1914091374)
Trevor RoyTrevor Roy

Make sure your "Badge Name" Apex variable is of type string and set to "Thanks".

The Apex query is looking for that name in the badge table, so any mismatch will return no rows (you can see this in the debug log when setting a campaign to completed).

Like so:

09:48:00:094 SOQL_EXECUTE_BEGIN [17]|Aggregations:0|SELECT Id, Name FROM WorkBadgeDefinition WHERE Name = :tmpVar1 LIMIT 1
09:48:00:099 SOQL_EXECUTE_END [17]|Rows:0

 

Julia HartweinJulia Hartwein
I have exactly the same issue:

We can't save this record because the “Completed Class Sessions” process failed. Give your Salesforce admin these details. <b>An unhandled fault has occurred in this flow</b> An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Error ID: 676449539-99570 (1914091374)


The badge name apex variable is set to "Thanks"

Any other idea?
Xiukai NingXiukai Ning
@Julia You will need to manually create a badge in Classic called "Thanks". This can be done in Badge object.
Janet KangJanet Kang
Badges are part of Work.com, which has separate licensing. Edit your user record and check the "Work.com User" checkbox. This will give you access to the badge records and the flow should work.

 Work.com User setting
Sreenivas VSreenivas V
Hi Janet,
   Thanks for the suggestion, even I have enabled work.com user in my user details, but as Xiukai mentioned we need to create a Badge called 'Thanks' in Badge object to complete this module successfully.
Thanks Xiukai and Janet.