• andream.ax1123
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

Hi,

I'm exporting data as csv using a Document object. I found a problem when I try to import the csv file into Microsoft Excel (Office 2007). The csv file is exported in utf-8 and excel expects an ansi file.

I've found a workaround importing the file instead of just opening it. But I want to know if there is any other easier way for the end-users of opening the file. Or another way of generating the file with ansi encoding.

 

thanks in advance,

Hi,

I'm exporting data as csv using a Document object. I found a problem when I try to import the csv file into Microsoft Excel (Office 2007). The csv file is exported in utf-8 and excel expects an ansi file.

I've found a workaround importing the file instead of just opening it. But I want to know if there is any other easier way for the end-users of opening the file. Or another way of generating the file with ansi encoding.

 

thanks in advance,

Note I'm not positive the subject of this post is the true reason for the bug.  The other possible explanation is:


Dynamic SOQL requires namespace prefixes when called in global context

 

Anyway, the bug is:

 

Our managed package occasionally uses Dynamic SOQL.  In one case, we have a controller that uses Database.query() without any namespace prefixes:

Database.query('select CustomField__c from CustomObject__c');

 

In another case, we call Database.getQueryLocator() (as part of a Database.Batchable implementation).  That query also does not include the namespace prefix:

global Database.queryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('select CustomField__c from CustomObject__c');
}

 

 


All of this works in our DE org, but once packaged & deployed, only the first one works.

 

The second ("getQueryLocator") throws an exception:

Developer script exception from iHance : 'i.Maintenance' : common.exception.ApiQueryException: No such column 'CustomField__c' on entity 'i__CustomObject__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.


I'm not sure if the bug is that getQueryLocator() requires the namespace prefix, or if Dynamic SOQL methods called in the global context do.  Without re-packaging everything to create a test case, there's no way for me to tell.

 

Salesforce support - I've created case 03501471 to track this issue.

  • April 23, 2010
  • Like
  • 0