title: I can not resolve this error in SugarCRM
body: <p>In SugarCRM (program management) module called "projects" by default does not come with the "import", it added eh following programming steps:</p>
  
  <pre><code>http://forums.sugarcrm.com/f148/how-add-importación-opción-custom-modules-45612/
  </code></pre>
  
  <p>Now I throw the error when I Import Next:</p>
  
  <blockquote>
    <p>Fatal error: Llamada a una función miembro get_importable_fields () en un no-objeto en C: \ Archivos de programa \ Apache Software Foundation \ Apache2.2 \ htdocs \ Azúcar \ modules \ Import \ v iews \ view.step3.php en línea 217</p>
  </blockquote>
  
  <p>Please somebody help me ... if necessary ... I will upload the file so they can help view.step3.php</p>
  
  <p>Here is the line 217:</p>
  
  <pre><code>        $fields  = $this-&gt;bean-&gt;get_importable_fields();
          $options = array();
          $defaultField = '';
          global $current_language;
          $moduleStrings = return_module_language($current_language, $this-&gt;bean-&gt;module_dir);
  </code></pre>
  
  <p>Here I publish the above lines:</p>
  
  <pre><code>class ImportViewStep3 extends ImportView
  </code></pre>
  
  <p>{</p>
  
  <pre><code>protected $pageTitleKey = 'LBL_STEP_3_TITLE';
  protected $currentFormID = 'importstep3';
  protected $previousAction = 'Confirm';
  protected $nextAction = 'dupcheck';
  
  /**
   * @see SugarView::display()
   */
  public function display()
  {
      global $mod_strings, $app_strings, $current_user, $sugar_config, $app_list_strings, $locale;
  
      $this-&gt;ss-&gt;assign("IMPORT_MODULE", $_REQUEST['import_module']);
      $has_header = ( isset( $_REQUEST['has_header']) ? 1 : 0 );
      $sugar_config['import_max_records_per_file'] = ( empty($sugar_config['import_max_records_per_file']) ? 1000 : $sugar_config['import_max_records_per_file'] );
      $this-&gt;ss-&gt;assign("CURRENT_STEP", $this-&gt;currentStep);
      // attempt to lookup a preexisting field map
      // use the custom one if specfied to do so in step 1
      $mapping_file = new ImportMap();
      $field_map = $mapping_file-&gt;set_get_import_wizard_fields();
      $default_values = array();
      $ignored_fields = array();
  
      if ( !empty( $_REQUEST['source_id']))
      {
          $GLOBALS['log']-&gt;fatal("Loading import map properties.");
          $mapping_file = new ImportMap();
          $mapping_file-&gt;retrieve( $_REQUEST['source_id'],false);
          $_REQUEST['source'] = $mapping_file-&gt;source;
          $has_header = $mapping_file-&gt;has_header;
          if (isset($mapping_file-&gt;delimiter))
              $_REQUEST['custom_delimiter'] = $mapping_file-&gt;delimiter;
          if (isset($mapping_file-&gt;enclosure))
              $_REQUEST['custom_enclosure'] = htmlentities($mapping_file-&gt;enclosure);
          $field_map = $mapping_file-&gt;getMapping();
          //print_r($field_map);die();
          $default_values = $mapping_file-&gt;getDefaultValues();
          $this-&gt;ss-&gt;assign("MAPNAME",$mapping_file-&gt;name);
          $this-&gt;ss-&gt;assign("CHECKMAP",'checked="checked" value="on"');
      }
      else
      {
          $classname = $this-&gt;getMappingClassName(ucfirst($_REQUEST['source']));
  
          //Set the $_REQUEST['source'] to be 'other' for ImportMapOther special case
          if($classname == 'ImportMapOther')
          {
              $_REQUEST['source'] = 'other';
          }
  
          if (class_exists($classname))
          {
              $mapping_file = new $classname;
              $ignored_fields = $mapping_file-&gt;getIgnoredFields($_REQUEST['import_module']);
              $field_map2 = $mapping_file-&gt;getMapping($_REQUEST['import_module']);
              $field_map = array_merge($field_map,$field_map2);
          }
      }
  
      $delimiter = $this-&gt;getRequestDelimiter();
  
      $this-&gt;ss-&gt;assign("CUSTOM_DELIMITER", $delimiter);
      $this-&gt;ss-&gt;assign("CUSTOM_ENCLOSURE", ( !empty($_REQUEST['custom_enclosure']) ? $_REQUEST['custom_enclosure'] : "" ));
  
     //populate import locale  values from import mapping if available, these values will be used througout the rest of the code path
  
      $uploadFileName = $_REQUEST['file_name'];
  
      // Now parse the file and look for errors
      $importFile = new ImportFile( $uploadFileName, $delimiter, html_entity_decode($_REQUEST['custom_enclosure'],ENT_QUOTES), FALSE);
  
      if ( !$importFile-&gt;fileExists() ) {
          $this-&gt;_showImportError($mod_strings['LBL_CANNOT_OPEN'],$_REQUEST['import_module'],'Step2');
          return;
      }
  
      $charset = $importFile-&gt;autoDetectCharacterSet();
  
      // retrieve first 3 rows
      $rows = array();
  
      //Keep track of the largest row count found.
      $maxFieldCount = 0;
      for ( $i = 0; $i &lt; 3; $i++ )
      {
          $rows[] = $importFile-&gt;getNextRow();
          $maxFieldCount = $importFile-&gt;getFieldCount() &gt; $maxFieldCount ?  $importFile-&gt;getFieldCount() : $maxFieldCount;
      }
      $ret_field_count = $maxFieldCount;
  
      // Bug 14689 - Parse the first data row to make sure it has non-empty data in it
      $isempty = true;
      if ( $rows[(int)$has_header] != false ) {
          foreach ( $rows[(int)$has_header] as $value ) {
              if ( strlen(trim($value)) &gt; 0 ) {
                  $isempty = false;
                  break;
              }
          }
      }
  
      if ($isempty || $rows[(int)$has_header] == false) {
          $this-&gt;_showImportError($mod_strings['LBL_NO_LINES'],$_REQUEST['import_module'],'Step2');
          return;
      }
  
      // save first row to send to step 4
      $this-&gt;ss-&gt;assign("FIRSTROW", base64_encode(serialize($rows[0])));
  
      // Now build template
      $this-&gt;ss-&gt;assign("TMP_FILE", $uploadFileName );
      $this-&gt;ss-&gt;assign("SOURCE", $_REQUEST['source'] );
      $this-&gt;ss-&gt;assign("TYPE", $_REQUEST['type'] );
      $this-&gt;ss-&gt;assign("DELETE_INLINE_PNG",  SugarThemeRegistry::current()-&gt;getImage('basic_search','align="absmiddle" alt="'.$app_strings['LNK_DELETE'].'" border="0"'));
      $this-&gt;ss-&gt;assign("PUBLISH_INLINE_PNG",  SugarThemeRegistry::current()-&gt;getImage('advanced_search','align="absmiddle" alt="'.$mod_strings['LBL_PUBLISH'].'" border="0"'));
  
      $this-&gt;instruction = 'LBL_SELECT_MAPPING_INSTRUCTION';
      $this-&gt;ss-&gt;assign('INSTRUCTION', $this-&gt;getInstruction());
  
      $this-&gt;ss-&gt;assign("MODULE_TITLE", $this-&gt;getModuleTitle(false));
      $this-&gt;ss-&gt;assign("STEP4_TITLE",
          strip_tags(str_replace("\n","",getClassicModuleTitle(
              $mod_strings['LBL_MODULE_NAME'],
              array($mod_strings['LBL_MODULE_NAME'],$mod_strings['LBL_STEP_4_TITLE']),
              false
              )))
          );
      $this-&gt;ss-&gt;assign("HEADER", $app_strings['LBL_IMPORT']." ". $mod_strings['LBL_MODULE_NAME']);
  
      // we export it as email_address, but import as email1
      $field_map['email_address'] = 'email1';
  
      // build each row; row count is determined by the the number of fields in the import file
      $columns = array();
      $mappedFields = array();
  
      // this should be populated if the request comes from a 'Back' button click
      $importColumns = $this-&gt;getImportColumns();
      $column_sel_from_req = false;
      if (!empty($importColumns)) {
          $column_sel_from_req = true;
      }
  
      for($field_count = 0; $field_count &lt; $ret_field_count; $field_count++) {
          // See if we have any field map matches
          $defaultValue = "";
          // Bug 31260 - If the data rows have more columns than the header row, then just add a new header column
          if ( !isset($rows[0][$field_count]) )
              $rows[0][$field_count] = '';
          // See if we can match the import row to a field in the list of fields to import
          $firstrow_name = trim(str_replace(":","",$rows[0][$field_count]));
          if ($has_header &amp;&amp; isset( $field_map[$firstrow_name] ) ) {
              $defaultValue = $field_map[$firstrow_name];
          }
          elseif (isset($field_map[$field_count])) {
              $defaultValue = $field_map[$field_count];
          }
          elseif (empty( $_REQUEST['source_id'])) {
              $defaultValue = trim($rows[0][$field_count]);
          }
  
          // build string of options
          $fields  = $this-&gt;bean-&gt;get_importable_fields();
  </code></pre>