I'm running into an issue with modifying the default Social Customer Service apex class and would really appreciate some guidance. I'm not a developer so this requirement is probably really simple to achieve, however I've hit a dead end...
The default class provided by SF for inbound social posts to Salesforce is as follows:
global class MyInboundSocialPostHandlerImpl extends
Social.InboundSocialPostHandlerImpl implements Social.InboundSocialPostHandler {
global override SObject createPersonaParent(SocialPersona persona) {
String name = persona.Name;
if (persona.RealName != null && String.isNotBlank(persona.RealName))
name = persona.RealName;
String firstName = '';
String lastName = 'unknown';
if (name != null && String.isNotBlank(name)) {
firstName = name.substringBeforeLast(' ');
lastName = name.substringAfterLast(' ');
if (lastName == null || String.isBlank(lastName))
lastName = firstName;
}
//You must have a default Person Account record type
Account acct = new Account (LastName = lastName, FirstName = firstName);
insert acct;
return acct;
}
global override String getDefaultAccountId() {
return '<account ID>';
}
global override Integer getMaxNumberOfDaysClosedToReopenCase() {
return 5;
}
}
...And instead of creating a new Person Account for each incoming social post/persona, I want to assign all Persona's to a default "shell" account record. Therefore I want to explicitly say in my class to find and use this shell account, every time.. I've tried a SOQL query to retrieve the shell account id, assigned it to a variable and attempted to use it in the following, but apparently I can't do this...
global override String getDefaultAccountId() {
return '<acct.ID>';
}
I've also tried hardcoding the ID just to test (I know it's a terrible way to handle this scenario), and that also gave me an error: invalid ID
Could anybody provide some insight on how to go about solving this?
Many Thanks!