Web to Case is available out-of-the box under Setup -> Customize -> Self Service -> Web to Case. This article is only intended to give you an understanding of Google forms and workflow rules on the "Email Message" object as well as one way of sending information to Salesforce from the google platform.
STEP 1:
You should be having a google Account. Click on the "Documents" link when you are in gmail. You can find it at the top bar as shown below.
STEP 2:
Create a new form as shown below.
STEP 3:
A sample form creation screen is shown below
Click the "Save" button to save the form.
STEP 4:
Now go back to your "Documents" tab as shown in STEP 1. You will now see a document named "Web to Case Form" and clicking on it would open up a spreadsheet as shown below.
Replace the value "XYZ" in the email variable with the "Email Service Address" that you noted down in STEP 5.
Go to "File" menu and select "Save". Give in some name and save the file.
Now, go to "Resources" menu and select "Current Script's Trigger" as shown below and save the changes.
STEP 1:
You should be having a google Account. Click on the "Documents" link when you are in gmail. You can find it at the top bar as shown below.
STEP 2:
Create a new form as shown below.
A sample form creation screen is shown below
Click the "Save" button to save the form.
STEP 4:
Now go back to your "Documents" tab as shown in STEP 1. You will now see a document named "Web to Case Form" and clicking on it would open up a spreadsheet as shown below.
GETTING TO THE SALESFORCE PART:
STEP 5:
Create a new Email to Case address as shown below and make a note of the Email Service Address.
STEP 6:
We will now create a workflow rule to update the CASE field PRIORITY with the value entered in the google form. Go ahead and create a workflow rule on the "Email Message" object.
NOTE: The entry criteria will be Email Message : Text Body contains "What is the severity :: High"
STEP 7:
Let's get back to google now. Open the document as shown in STEP 4.
Click on the "Tools" menu and select "Script Editor". Paste the following code in the editor window.
function sendFormByEmail(e)
{
// Remember to replace XYZ with your own email address
var email = "XYZ";
// Optional but change the following variable
// to have a custom subject for Google Docs emails
var subject = "Google Docs Form Submitted";
// The variable e holds all the form values in an array.
// Loop through the array and append values to the body.
var message = "";
for(var field in e.namedValues) {
message += field + ' :: '
+ e.namedValues[field].toString() + "\n\n";
}
MailApp.sendEmail(email, subject, message);
}
Replace the value "XYZ" in the email variable with the "Email Service Address" that you noted down in STEP 5.
Go to "File" menu and select "Save". Give in some name and save the file.
Now, go to "Resources" menu and select "Current Script's Trigger" as shown below and save the changes.
STEP 8:
Now, go to your Google form. Select the Priority as "High" and submit the form. Your Case is created in Salesforce and the Priority is updated as "High".
This article covers the SFDC table which stores Chatter Follower information (ie It stores which user follows which Account, Contact , or any record or User).
The table is
EntitySubscription:
The fields in this table are
ParentId: The ID of the Account, Contact or any record or User.
SubscriberId: The ID of the user who follows the record denoted in the Parent ID.
Querying this object would give you Follower Information
For Example:
To Add followers automatically using Apex, you could insert records into this object. And to Un-follow just delete the relevant records.
The table is
EntitySubscription:
The fields in this table are
ParentId: The ID of the Account, Contact or any record or User.
SubscriberId: The ID of the user who follows the record denoted in the Parent ID.
Querying this object would give you Follower Information
For Example:
List<EntitySubscription> myaccsubscribers = [Select ParentId,SubscriberId
from EntitySubscription where ParentId = '500Q11100046Vt3'];
To Add followers automatically using Apex, you could insert records into this object. And to Un-follow just delete the relevant records.
EntitySubscription newfollower = new EntitySubscription();
newfollower.ParentId = 'insert id here';
newfollower.SubscriberId = 'insert the user id here';
insert newfollower;