The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
1answer
23 views

Days of Opportunity Stage

We can capture the number of days the opportunity stayed in a stage using custom field+wf+field update. This works on the current records and on the existing records if they are edited(the value will ...
0
votes
1answer
22 views

How to Query for information from Opportunity Trends Report?

I'd like to query Salesforce with an SOQL query that can attain the 'Historical Amount' as of a given date in the same way that we can attain this information from an Opportunity Trends Report. ...
0
votes
1answer
50 views

Code Coverage for OpportunityHistory For Loop in Batch Class

How to get coverage for this *Batch Class : ---- --- other code --- for(Task objTask : listTask){ for(OpportunityHistory obj : listOppHistory){ if(objTask.CreatedDate > ...
1
vote
2answers
373 views

How to get Opportunity Stage History SOQL

What is the best way to get Opportunity Stage Change History using SOQL? Basically, what I need is the same list as in Opportunity page in Salesforce, where list of stages and dates of modifications ...
1
vote
1answer
80 views

OpportunityFieldHistory: NewValue and OldValue

I have a question about the stagehistory. I am trying to get the number of times an opportunity enters a specific phase during, for example, this week (or lastw eek). I tried this query: select ...
0
votes
1answer
25 views

Grouping StageName history by CreatedDate

I am struggling with this query I am trying to do. I want to count how many times we went to a specific stage grouped by weeks. There is something very strange though, I can select count(stagename) ...
0
votes
3answers
531 views

Can you query by LastModifiedDate on OpportunityHistory?

This query: select ID, StageName, Probability, Amount, CloseDate from OpportunityHistory where OpportunityId = 123 and LastModifiedDate > 2015-01-01T00:00:01z Throws this error: No such column ...
0
votes
1answer
359 views

List Opportunities that have a previous StageName [Advanced SOQL]

I'm trying to get a list of Opportunities that have now "Cancelled" (isClosed=true and isWon=false) stageName and the previous (Penultimate) value was "Active" by SOQL . For example, the Opp X had ...
1
vote
0answers
351 views

Customize Opportunity - Related List Stage History

I have a requirement where I need to add fields in stage history related list. Please help me.
1
vote
2answers
459 views

Getting Object type not accessible error

Since today morning i am getting following error whenever i try to open any opportunity. Object type not accessible. Please check permissions and make sure the object is not in development mode: ...
1
vote
1answer
253 views

How do I see the audit trail for Products added to a Opportunity

How do I see the audit trail for Products fields e.g. change in quantity or change in salesprice, for a Product added to a Opportunity
2
votes
0answers
69 views

Batch Apex: Invalid field StageName for OpportunityHistory

In my SalesForce managed package I have a Batch Apex job that queries OpportunityHistory and does some post-processing (basically serialize them and posts to external Web Service) When I schedule and ...
5
votes
2answers
3k views

How to track history of a record of a custom object in apex class?

I want to track history(History which is shown below every record in salesforce user interface) of a record in apex class. How can i do this? What will be used in SOQL query?
0
votes
1answer
59 views

Values in OpportunitiesHistory do not seem to be there

My test does: Opportunity opp2 = opps.get(1); opp2.probability = 40; upsert(opp2); opp2.probability = 30; upsert(opp2); System.debug('****opp2History=' + opp2.OpportunityHistories); I was ...
1
vote
2answers
808 views

Accessing OpportunityHistory in a SOQL query

My query: List<Opportunity> opps = [SELECT id, Probability, LastModifiedDate, OwnerId, (SELECT StageName,Probability,SystemModstamp FROM OpportunityHistories order by ...
2
votes
3answers
302 views

Setting SystemModstamp for OpportunityHistory

I have some logic where I have to send emails about Opportunities that have certain OpportunityHistory objects at certain date times. I would like to test this but it means I need to be able to ...