vtiger510:Plugin Webforms
From http://wiki.vtiger.com/archives
This documentation applies to vtigerCRM 5.2.1 and vtigerCRM 5.2.0
Contents |
About
Webforms are optional modules as of vtiger 5.1.0, and installed or imported from module manager. Webforms in vtiger CRM 5.1.0 is build using the REST based webservices exposed on 5.1.0. One can build a form using any of form building tools available on the net, example jotform, wordpress formbuilder plugin etc. the fieldname should match with the fieldname exposed by webservices, refer webservice documentation available here, one important additional information that needs to provided is the module name a hidden field with name 'moduleName' should be enough. The form should have POST method.
Webforms End point
If webforms extension is installed, then one should be able to push data into vtiger CRM by pointing their webforms to the URL, http://vtiger_url/modules/Webforms/post.php
Configuration of Webforms
Before webforms can be used one has to configure it, there is file called Webforms.config.php in vtigerRoot/modules/Webforms/ folder. The configuration file has following settings,
•defaultUserName: User credentials used for authentication for the webforms.
•defaultUserAccessKey: Access key for the user, available in 'My Preference' page.
•defaultOwner: Name of the user to whome all the records created from webforms will be assigned to.
•successURL: an url to redirect to if the operation was successful.
•failureURL: an url to redirect to if the operation was unsuccessful.
•defaultSuccessAction: if no success/failure url is specified then the type of response desired to the server, acceptable values are HTML and JSON.
•defaultSuccessMessage: label key used to look-up the success message from language file.
Note :- when creating the webform all the Mandatory fields should be given in the webform otherwise the record creation will fail.
A Demo Form for Leads
<form method="POST" action="http://vtiger_url/modules/Webforms/post.php"> <input type="hidden" value="Leads" name="moduleName" /> <table> <tbody> <tr> <td><label>Last Name</label></td> <td><input type="text" name="lastname" value="" /></td> </tr> <tr> <td><label>First Name</label></td> <td><input type="text" name="firstname" value="" /></td> </tr> <tr> <td><label>Company</label></td> <td><input type="text" name="company" value="" /></td> </tr> </tbody> </table> <input type="submit" value="Submit" /> </form>
A Demo Form for Leads with custom field
<form method="POST" action="http://vtiger_url/modules/Webforms/post.php"> <input type="hidden" value="Leads" name="moduleName" /> <table> <tbody> <tr> <td><label>Last Name</label></td> <td><input type="text" name="lastname" value="" /></td> </tr> <tr> <td><label>First Name</label></td> <td><input type="text" name="firstname" value="" /></td> </tr> <tr> <td><label>custom field</label></td> <td><input type="text" name="name of custom field in database" value="" /></td> </tr> <tr> <td><label>Company</label></td> <td><input type="text" name="company" value="" /></td> </tr> </tbody> </table> <input type="submit" value="Submit" /> </form>
A Demo Form for Leads to add data to Multi Select Combo Box
<<form method="POST" action="http://vtiger_url/modules/Webforms/post.php"> <input type="hidden" value="Leads" name="moduleName" /> <table> <tbody> <tr> <td><label>First Name</label></td> <td><input type="text" name="firstname" value="" /></td> </tr> <tr> <td><label>Last Name</label></td> <td><input type="text" name="lastname" value="" /></td> </tr> <tr> <td><label>Company</label></td> <td><input type="text" name="company" value="" /></td> </tr> <tr> <td><label>Multi-Select Combo Box</label></td> <td> <select multiple size="3" name ="cf_616[]"> <OPTION VALUE="val1"> Option 1 </option> <OPTION VALUE="val2"> Option 2 </option> <OPTION VALUE="val3"> Option 3 </option> <OPTION VALUE="val4"> Option 4 </option> </select> </td> </tr> </tbody> </table> <input type="submit" value="Submit"/> </form>
Webforms Integration
Thanks to Chares for putting up the document on getting the webforms integrated to capture leads on Drupal / Joomla / Wordpress. Follow the forum post: VTiger WF Leads Drupal/Joomla/WordPress




