Salesforce: Is there any way to set System time in test class

So I have a trigger and a schedule class. The trigger will fire upon update on an object and schedule a job which will execute the scheduled class. There is some logic in the trigger related to non-working hours, weekends and holidays. It will usually schedule the job 1 hour after insert (due to business requirement). but if insert happens over the weekend, afterhours, or holidays. It will schedule the next business day 8am.

Opportunity Management

This is my first post here on the StackExchange and hoping someone can help. I have been tasked with finding a way to prevent users from moving to 70% or greater probability in an opportunity when Opportunity Products with a certain record type exist. We have valid SAP products and what we call Prospect Products (these shouldn’t be allowed in opportunity with 70% or greater probability). We are also thinking of adding a field to the product table for prospect products that are “allowed” so those would obviously need to be excluded from the criteria and can be allowed in the forecast.

Governor Limit question: Large data set. How do I avoid hitting governor limits?

We have a pretty complex trigger suite on our org. We’ve built a lot of custom functionality. I’m starting to worry about governor limits and not really understanding how to manage them. I’ve read through and I’ve made all my triggers accordingly, using as few SOQL and DML statements as possible, querying the database only when I have to and getting all the records I need at once, etc.

Is it possible to create a method that uses generics?

The question: … or at least pass in a specific class? Here is what I have right now: private static invoice_response GetResponse(String jsonResponse) { invoice_response deserialized = (invoice_response) JSON.deserialize(jsonResponse, invoice_response.class); return deserialized; } Since I have to deserialized a bunch of things… I’d like to have the following with Generics or perhaps another way: private … Read more

Test Class SeeAllData=true Annotation

I am creating a test class that will test my controller class which uses almost 5 to 8 objects that has many DML statements like insert and delete, however I am feeling a little bit worried about not getting the result like in my controller class. As a turnaround I used the SeeAllData=True annotation in order not to make sample data for each object and to cover most of my codes.

Create Visualforce page with dynamic number of GaugeSeries charts

I want to display, on a single page, a gauge chart for each record of a certain type (Scholarship Campaign) that is currently active. This number may change at any time, and the specific records being pulled may change at any time. With apex:gaugeSeries, you load a list of data and it uses the first entry only for that chart. My idea was to then create a list that contains all of those data lists List<List<GaugeData>> lofl, then iterate through that list on the Visualforce page. This does not seem to work however; it does not render anything on the page with it set up that way.