Bradley Delaune
  • Member for 8 years
  • Last seen more than 3 years ago
  • Dallas, TX
Prevent trigger from running in single test
Accepted answer
10 votes

The only way to do this would be to code the functionality into your trigger. You could make use of static variables to prevent the trigger from running. Just create some class public class ...

View answer
Database.rollback() risks and alternative
Accepted answer
8 votes

I wish I had some very clear documentation, but to be honest, I don't. I assume you found the small amount of documentation on savepoints and rollbacks here: https://developer.salesforce.com/docs/...

View answer
Salesforce trigger throws read only exception upon insert
6 votes

You can't assign a value to the Trigger.new collection in an after trigger. brandnew is a record coming from the trigger, so when you attempt to assign true it give you an error. Now, more ...

View answer
Can I create an index on a field to speed up searching?
Accepted answer
4 votes

You can submit a Case through the Salesforce Success Community to have Salesforce index a field. Also, assigning a field as an ExternalId will index it. EDIT: Found the documentation regarding ...

View answer
can I concatenate field values form a related list into a formula field?
Accepted answer
4 votes

The only way to do this is with a trigger that does the concatenation when the child record is inserted, updated, or deleted. This is a very costly trigger to write and you should proceed with ...

View answer
Adding rows dynamically to a pageblocktable even if the values in the required fields for existing rows are blank
4 votes

There is a tag on commandButton and commandLink called immediate http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_commandButton.htm Setting this to true on your addRow button ...

View answer
Developer Console security
Accepted answer
3 votes

Enabling the Developer Console requires more than just "API Enabled". See Using the Developer Console for all the permissions required. One of them is "View All Data" so yes, it would give users ...

View answer
Merge Data from Multiple List<SObject> for use in Update/Insert
Accepted answer
3 votes

In your example you provided, you are very close. The only thing you need to understand is that in the Java world (and therefore the Apex world), any non-primitive data types are pass-by-reference. ...

View answer
Custom Setting issue in Test Class
Accepted answer
3 votes

Could you try using getOrgDefaults() instead of getInstance()? I wonder if there is something weird where it may be applying the Custom Setting to your ID when you do the upsert instead of the ...

View answer
Tough spot: updated State/Country fields to picklists but now code coverage is too low!
Accepted answer
3 votes

Managed Package code coverage should not affect your own deployment of code in your org's namespace: Unit Test Code Coverage and Managed Packages You should be able to bring your own code coverage up ...

View answer
Card Reader Output into Salesforce
3 votes

You are going to have some major challenges designing something like that in visualforce because of how particular mobile phones are about accessing microphone jacks or usb ports. Your best bet is ...

View answer
Updating checkbox with a custom button
2 votes

You're going to want to use a javascript button. Here is some sample code on the Account object where the name of the field is "Checkbox__c": {!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")} ...

View answer
taking rest response value from javascript to apex class
2 votes

I'm not sure why you would want to do this, but here's a potential solution: Because you're getting the raw response via javascript on the page, you'll need to add the reponse to the view state. ...

View answer
VF remote object paganition
Accepted answer
2 votes

Here's an example: var ct = new RemoteObjectModel.Contact(); ct.retrieve( { where: { FirstName: {eq: 'Marc'}, LastName: {eq: 'Benioff'} }, orderby: [ {LastName: '...

View answer
Can I override Salesforce Sales Console Standard List View?
Accepted answer
2 votes

Well you can't technically override the standard list view, but you can still accomplish what you are asking: Create your Visualforce page you'd like to override the list view with. Create a ...

View answer
Apex Test Class - Limits Query
Accepted answer
2 votes

a). No, when you execute a test class, it runs every method in the test class. b). Governor limits are reset for each test method. In addition, some governor limits are reset in between the Test....

View answer
How to start with Salesforce Analytics Cloud on developer account?
2 votes

Unfortunately Analytics Cloud is so new that it is near impossible to get a free "developer" version to play with. I work for a Salesforce Partner and we couldn't even get a demo or trial. Give the ...

View answer
soql subquery in SELECT clause
Accepted answer
2 votes

Subqueries are possible but they are not aliasable nor can you select anything that isn't a "child" object of the main object you are selecting. Example right from the documentation: SELECT Account....

View answer
Deploying change sets into production
2 votes

The only time metadata components are overridden is when you have modified an existing component and you are deploying that component. In your example, the field you created in production will be ...

View answer
How we use SASS-Compass to design our VisualForce page
2 votes

Salesforce cannot compile SASS, LESS, or any other web pre-compiled languages. Any code you add to salesforce must be in a CSS format to use in Visualforce. If you use Grunt to manage your compile ...

View answer
How do I dynamically reference a Record Type ID in a Custom Setting?
2 votes

Check out this Apex Interface: InstallHandler Interface Should allow you to query for the RecordType Id and insert it into the custom setting when the user installs the managed package.

View answer
integration salesforce with heroku
2 votes

Heroku is issuing a permanent redirect that you need to follow. Most tools that help you test APIs annoyingly auto-redirect for you. If you analyze the headers in the 301 response, there is a header ...

View answer
after update trigger causes unexpected exception
Accepted answer
2 votes

You are doing an after update trigger and trying to update the records send to you via Trigger.new. Please see this page to see what actions are available in each type of trigger: http://www....

View answer
FeedComment trigger - update parent case when chatter post receives a reply
Accepted answer
1 votes

Trigger is looking good, but I'd still like to offer my $0.02 and summarize the discussion thus far. A couple points: Bulkify the Trigger. Your Update CaseToUpdate could potentially cause an issue. ...

View answer
how to override addproduct button of opportunity
1 votes

You cannot override the "Add Products" button without overriding the Pricebook selection page as well. Your VF page will need to handle picking the Pricebook prior to allowing adding products. I've ...

View answer
How to get url for facebook profile photo in contact
1 votes

In Apex you should Query directly for the Contact: Contact c = [SELECT PhotoUrl FROM Contact WHERE Id = :contactId LIMIT 1]; No need to make a ReST callout from Apex.

View answer
need to store date time based on customer timezone
1 votes

Yes You can implement a double web service to hit any Geolocation API then any Timezone API. Here is Google's Geolocation API which will get you a latitude and longitude of City/State combo. Here is ...

View answer
How to compare a text value in a list of sobjects?
Accepted answer
1 votes

This should work: List lst_PartnersAcc = [SELECT CUST_NUM__c FROM SYSTEMS__c WHERE Account__c IN (Select AccountId from AccountShare where ( ...

View answer
Case Management Contact Name
Accepted answer
1 votes

I don't think you can just substitute the main Contact field with a User lookup, but there may be a workaround with some custom code. You could write a trigger that automatically creates/updates/...

View answer
a way to check current field history data retention
1 votes

Based on my reading, I don't think there is any way to know if the default values are still configured or if they have been overridden. You will just have to compare the metadata files to the known ...

View answer