• jflint86
  • 0 Points
  • Member since 2009

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1

I rely heavily on Excel for generating complex reports from Salesforce.  I use Office Connect to import unformatted reports and use Excel to combine and format the data.  For some reason, after the initial import of some reports, the refresh report does not work.  for example, I have a spreadsheet where I have imported 5 different reports.  When I select "Refresh All", only 3 will refresh.  For the other two reports, I have to delete the old report and re-import them. 


I'm using the latest version of Office Connect and Office 2007. 


Any ideas on how to get my reports to refresh every time?


2 issues.


1.  var a never gets the actual salesforce 15 digit id for the custom object "Location__c". How do I get this value?

2. When I build the query I ge the message "unexpected token".  How do I use a variable like "a" in a query statement such as below?:





var a = {!Location__c.Id}

var result = sforce.connection.query("SELECT Id FROM Promo_Material_Snapshot__c"+
" WHERE Location__c = a limit 1")


var records = result.getArray("records")

var IdsToClone = String(records[0]).substring(40, 55)


window.open("/"+IdsToClone +"/e?clone=1&retURL=/"+IdsToClone )