• Luigi Montanez
  • NEWBIE
  • 0 Points
  • Member since 2007

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

I have this SOQL query for an inline s-control:

SELECT Opportunity.Amount, Opportunity.Name, Opportunity.Id
FROM OpportunityContactRole WHERE ContactId = '{!Contact.Id}'
AND Role = 'Raiser' AND Opportunity.Amount <> 0


Assuming the query result is called queryResult, I want to sum up the Opportunity.Amount values using the following code:

total = 0
// assign the results of the query to an array.
records = queryResult.getArray('records');

// iterate over the results and sum the total.
for(var n in records) {
var opp = records[n];
//Add the current premium's amount to the running total.
total += opp.getFloat('Opportunity.Amount');
}

When I run this, I get the error: 'Unable to parse float field: Opportunity.Amount'

The last line works fine if I have a query dealing with only Opportunities and try to getFloat('Amount') instead of getFloat('Opportunity.Amount'). But something about the Opportunity.Amount part breaks getFloat(), and I don't know how to work around it.

Thanks in advance.

Summer '08 Metadata API Support adds the following Salesforce components:
  • Home Page Components
  • Home Page Layouts
  • Page Layouts
  • Validation Rules
  • Workflows
Project Contents Selection lets you control what to download:
  • All packages and default unpackaged components (identical to previous releases)
  • Single package
  • Selected metadata types only
  • None (if loading project from version control system)

Usability Enhancements
  • Simplified connection options in the New Force.com Project wizard
  • Refresh objects list from within the New Apex Trigger and New Workflow wizards
  • Force.com Projects now use Eclipse proxy server settings, rather than per-project settings
  • Improved stability and performance

Resources
Visit the IDE Home Page on developer.force.com, or jump straight to the information you want:



Message Edited by JonP on 06-19-2008 02:05 PM
  • June 17, 2008
  • Like
  • 0
I just posted an updated build of the ApexDataLoader for OSX. (its using the 10.0 DataLoader, so has all the upsert features).
see http://www.pocketsoap.com/weblog/2008/01/1800.html
Hi,

I have this SOQL query for an inline s-control:

SELECT Opportunity.Amount, Opportunity.Name, Opportunity.Id
FROM OpportunityContactRole WHERE ContactId = '{!Contact.Id}'
AND Role = 'Raiser' AND Opportunity.Amount <> 0


Assuming the query result is called queryResult, I want to sum up the Opportunity.Amount values using the following code:

total = 0
// assign the results of the query to an array.
records = queryResult.getArray('records');

// iterate over the results and sum the total.
for(var n in records) {
var opp = records[n];
//Add the current premium's amount to the running total.
total += opp.getFloat('Opportunity.Amount');
}

When I run this, I get the error: 'Unable to parse float field: Opportunity.Amount'

The last line works fine if I have a query dealing with only Opportunities and try to getFloat('Amount') instead of getFloat('Opportunity.Amount'). But something about the Opportunity.Amount part breaks getFloat(), and I don't know how to work around it.

Thanks in advance.