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
Vattana ChhayVattana Chhay 

Apex class for social customer service - Social studio

Hello guys,
Hope you're going well.
I have a question concerning the Social Customer Service- particularly the paying version -> Social Studio.
This version allow to edit the apex on the Salesforce setup (Setup - Social Media-Inbound Settings). My question is: Is there an apex class that allow us to create cases automatically based on keyword that have been detected on social network ??

If yes, do you know where can I find a code library as I'm a not developper.

Many thanks !
NagendraNagendra (Salesforce Developers) 
Hi Vattana Chhay,

The default code for Social Customer Service is available on the Salesforce Help site here(https://help.salesforce.com/articleView?id=social_customer_service_apexclass_ref.htm&language=en_US&type=0). There is also a test class(https://help.salesforce.com/articleView?id=social_customer_service_apexclass_test.htm&type=0) provided for it.

This will create social personas if they do not already exist, create social post records and add or update cases as new social posts or responses are received.

Guidance on modifying the default class is here(https://help.salesforce.com/articleView?id=social_customer_service_apexclass.htm&language=en_US&type=0).

This cannot be used with the starter pack

You can’t modify the default Apex class if you are using the Starter Pack. The free Starter Pack lets you simply connect up to two social accounts and Salesforce handles the rest of the details, like a Social Studio account.
If you alter the default Apex class, be sure to select your new Apex class on the setup page, where you can also see Apex processing errors. From Setup, enter Social Media in the Quick Find box, then select Settings. An email is sent to the administrator when there are errors and, in most circumstances, the data is saved and can be reprocessed. If too many errors are waiting for reprocessing, the Salesforce Social Hub rules are automatically paused to ensure social content is not missed.

Thanks,
Nagendra.