+ Start a Discussion
Developer 007Developer 007 

Remotely adding New Activity (Events) to Campaigns

Hello everyone,


I'm trying to create a form on my website that will take registrants information and feed them to Event Activity under a specific Campaign that was created in SalesForce.  I have done some research, however have gotten more and more confused.  Are there any existing PHP codes or modules that I can utilize to get this done? 


Any help is greatly appreciated!



Park Walker (TAGL)Park Walker (TAGL)

You will need to create a new Event with WhatId set to the Campaign Id you want it linked to. You can find documentation on all of the standard fields in the API documentation.

Developer 007Developer 007

Thank you so much for your response.  I appologize if my questions is elementary as I'm just starting to learn SalesForce API and usage.


I can look up the standard field names, however to take a step back (or forward), how does my form going to communicate with SF?  What are the adjustments would I have to make to get this working?  Also, is the WhatId set correctly?


<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
    <input type=hidden name="retURL" value="http://mydomain.com">

    <input type=hidden name="WhatId" value="xxxxxxxxx">
    <input type=hidden name="sObj" value="Event">
    <label for="WhoId">Contact/Lead ID:</label>
    <input type="text" id="WhoId" name="id_WhoId" maxlength="18" size="20" /><br />
    <label for="Description">Description:</label>
    <textarea id="Description" name="textarea_Description"></textarea><br />
    <label for="DurationInMinutes">Duration:</label>
    <input type="text" id="DurationInMinutes" name="integer_DurationInMinutes" maxlength="8" size="20"/><br />
    <label for="RecurrenceEndDateOnly">End Date:</label>
    <input type="text" id="RecurrenceEndDateOnly" name="date_RecurrenceEndDateOnly" maxlength="20" size="20" /><br />
    <label for="EndDateTime">End Date Time:</label>
    <input type="text" id="EndDateTime" name="datetime_EndDateTime" maxlength="20" size="20" /><br />
    <label for="Location">Location:</label>
    <input type="text" id="Location" name="string_Location" maxlength="255" size="20" /><br />
    <label for="StartDateTime">Start Date Time:</label>
    <input type="text" id="StartDateTime" name="datetime_StartDateTime" maxlength="20" size="20" /><br />
    <input type="submit" name="submit" id="submitbox" value="Submit!">



Park Walker (TAGL)Park Walker (TAGL)

You said that you were using the API, but the HTML you provided is just HTML targeted at the Web-to-Lead processor. You cannot create an Event using Web-to-Lead. 


Using the API entails writing code which runs on your web server to talk to Salesforce. If you are a programmer and want to use this method the best place to start is with the API documentation. You can poke around on the boards here and use Google to find some example code.


The WhatId will be the Id value of the Campaign that you wish to attach to.