You need to sign in to do that
Don't have an account?
MarkMCC
Help With Query
have a chart displaying Sales Quota vs. Total Sales by month for each sales user (i pass in a REP_ID from the apex page).
However the months display on the graph like...
Jan Mar Feb
How can i have it display in order by month? Below is my current query.
SELECT Month__c, Quota__c, Sales__c From Sales_Quota__c Where Rep_Review__r.id = ' "
I cant add Order By Month__c at the end as it doesnt pull in the ID when i go to the APEX page.
Thanks for any help!
It sounds like you want a collection to be ordered by month order. It's hard to say what the best way to do that would be without seeing your code. Can you post the relevant parts of your page and controller?
Jeremy
Thanks for the help! Below is the code and i highlighted the data query in red. The below works fine, however doesnt sort the months correctly.
Thanks,
Mark
What if you have a field on your Sales Quota object that contains an integer referring to the number of the month based on the month name. This could be a simple formula field. Then in your query, add "order by Month_Number__c".
Good luck,
Jeremy
Where would the order by statement go? Becuase I cant put it at the end as the ID that the page is passing doesnt work and it doesnt work if I add it before the Rep_Review__r.ID field.
It should go at the end of your query string. Are you saying you tried that and you got an error of some kind? What did you get? Be careful of leaving spaces between words.
Jeremy
This is what I have and the data doesnt pull onto the chart.
Rep_Review__r looks like a relationship reference. I think you might want to replace "Rep_Review__r.id" with "Rep_Review__c" in your expression.
The chart displays on an Object Called Rep Review.
The sales quotas are linked to the rep review object by a lookup field.
So I need to pull the sales quotas that have a rep review id of XXX
If your lookup field is called Rep_Review__c, then Rep_Review__c is the field that contains the ID you are looking for. Use that field, not the relationship reference you have now. Relationships and lookup fields are a little confusing sometimes.
Jeremy
Hello everone,
I am trying to query Quota but I am unable to query it.
Can anyone please tell me how to query quota .