You are here

function salesforce_api_fieldmap_objects in Salesforce Suite 5.2

Same name and namespace in other branches
  1. 6.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_objects()
  2. 7 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_objects()
  3. 7.2 salesforce_api/salesforce_api.module \salesforce_api_fieldmap_objects()

Implementation of hook_fieldmap_objects().

File

salesforce_api/salesforce_api.module, line 314
Defines an API that enables modules to interact with the Salesforce server.

Code

function salesforce_api_fieldmap_objects($type) {
  $objects = array();

  // Define the data fields available for Salesforce objects.
  if ($type == 'salesforce') {
    $objects['campaign'] = array(
      'label' => t('Campaign'),
      'fields' => array(
        'Name' => array(
          'label' => t('Name'),
          'type' => SALESFORCE_FIELD_REQUIRED,
        ),
        'Description' => array(
          'label' => t('Description'),
        ),
        'StartDate' => array(
          'label' => t('Start date'),
        ),
        'EndDate' => array(
          'label' => t('End date'),
        ),
        'IsActive' => array(
          'label' => t('Is the campaign active?'),
        ),
        'Status' => array(
          'label' => t('Status'),
        ),
        'Type' => array(
          'label' => t('Type'),
        ),
        'NumberSent' => array(
          'label' => t('Number of e-mails sent'),
        ),
        'ExpectedResponse' => array(
          'label' => t('Expected response'),
        ),
        'BudgetedCost' => array(
          'label' => t('Budgeted cost'),
        ),
        'ActualCost' => array(
          'label' => t('Actual cost'),
        ),
        'ExpectedRevenue' => array(
          'label' => t('Expected revenue'),
        ),
        'OwnerID' => array(
          'label' => t('Owner ID'),
        ),
      ),
    );
    $objects['contact'] = array(
      'label' => t('Contact'),
      'fields' => array(
        'Email' => array(
          'label' => t('E-mail address'),
        ),
        'FirstName' => array(
          'label' => t('First name'),
        ),
        'LastName' => array(
          'label' => t('Last name'),
          'type' => SALESFORCE_FIELD_REQUIRED,
        ),
        'Name' => array(
          'label' => t('First and last name'),
          'type' => SALESFORCE_FIELD_SOURCE_ONLY,
        ),
        'Phone' => array(
          'label' => t('Primary phone number'),
        ),
        'BirthDate' => array(
          'label' => t('Birthdate'),
        ),
      ),
    );
    $objects['lead'] = array(
      'label' => t('Lead'),
      'fields' => array(
        'Company' => array(
          'label' => t('Company'),
          'type' => SALESFORCE_FIELD_REQUIRED,
        ),
        'FirstName' => array(
          'label' => t('First name'),
        ),
        'LastName' => array(
          'label' => t('Last name'),
          'type' => SALESFORCE_FIELD_REQUIRED,
        ),
        'Salutation' => array(
          'label' => t('Salutation'),
        ),
        'Name' => array(
          'label' => t('First and last name'),
          'type' => SALESFORCE_FIELD_SOURCE_ONLY,
        ),
        'Title' => array(
          'label' => t('Title'),
        ),
        'Street' => array(
          'label' => t('Street address'),
        ),
        'City' => array(
          'label' => t('City'),
        ),
        'State' => array(
          'label' => t('State'),
        ),
        'PostalCode' => array(
          'label' => t('Zip/Postal code'),
        ),
        'Country' => array(
          'label' => t('Country'),
        ),
        'Phone' => array(
          'label' => t('Phone number'),
        ),
        'MobilePhone' => array(
          'label' => t('Mobile phone'),
        ),
        'Fax' => array(
          'label' => t('Fax number'),
        ),
        'Email' => array(
          'label' => t('E-mail address'),
        ),
        //'HasOptedOutOfEmail' => array('label' => t('Has the lead opted out of e-mail?')),
        'Website' => array(
          'label' => t('Website'),
        ),
        'Industry' => array(
          'label' => t('Industry'),
        ),
        'Description' => array(
          'label' => t('Description'),
        ),
        'AnnualRevenue' => array(
          'label' => t('Annual revenue'),
        ),
        'NumberOfEmployees' => array(
          'label' => t('Number of employees'),
        ),
        'LeadSource' => array(
          'label' => t('Lead source'),
        ),
        'Rating' => array(
          'label' => t('Lead rating'),
        ),
        'Status' => array(
          'label' => t('Lead status'),
        ),
        'IsConverted' => array(
          'label' => t('Is the lead converted?'),
        ),
        'IsUnreadByOwner' => array(
          'label' => t('Is the lead unread by its owner?'),
        ),
      ),
    );
  }
  return $objects;
}