Most Popular

1500 questions
65
votes
1 answer

Setting a from address in SingleEmailMessage

I want to set a from address in a salesforce SingleEmailMessage, but can't see a way to do this and there is no standard method described in the documentation. I want the email to be sent from doNotReply@blahblah.com, however, the email address of…
c14kaa
  • 1,096
  • 2
  • 10
  • 14
65
votes
4 answers

Call Apex class method on the fly (dynamically)

Is there any way I can call apex method from class if both class name and method are stored in the string. String strClass = 'BatchUtil'; String strMethod = 'updateAccounts' now I want to call above method.. is it possible ? I was doing research…
Prafulla Patil
  • 5,722
  • 10
  • 47
  • 67
63
votes
3 answers

What's the practical difference between canvas & connected apps?

Question What's the point of canvas vs. connected apps, and what should I be thinking about when choosing between them? Background We're in the process of building out a couple tools that will be integrated with our Salesforce instance and I'm…
Ralph Callaway
  • 24,529
  • 17
  • 112
  • 190
63
votes
10 answers

What would be the best approach to get the recordtype id

I know of two approaches to get the recordtype id of a particular record type Use SOQL RecordType RecType = [Select Id From RecordType Where SobjectType = 'Account' and DeveloperName = 'Business']; Benifit here is if the admin changes the name…
Prady
  • 12,276
  • 35
  • 131
  • 236
62
votes
6 answers

How to run a scheduled job every 15 minutes?

Using the salesforce GUI it seams impossible to schedule a job every 15 minutes. Or more than once a day.
Christian Deckert
  • 5,219
  • 4
  • 33
  • 68
61
votes
3 answers

What is the difference between Aura and Lightning frameworks?

Apart from Wave, the biggest announcement from a developer perspective at Dreamforce 2014 is "Lightning" and it will be announced in the big keynote by Marc Benioff today. I've started to play around with it a bit and I'm really trying to understand…
Gaurav Kheterpal
  • 15,565
  • 1
  • 28
  • 54
61
votes
1 answer

Using sObject.get() to fetch a field value from a related parent object

I have a contact in a generic sObject in apex and while I'm able to easily get detail field values using sObject.get('MyContactField__c') I'm not able to get fields off the related parent object, and I'm sure the related field is in memory, based…
greenstork
  • 14,752
  • 2
  • 44
  • 71
60
votes
3 answers

Lead Conversion Trigger Order of Execution

I've got a project where I'm looking to tweak the standard lead conversion process. Triggers and lead conversion has always been funky in past projects so I was hoping to start the design off by reviewing the order of execution, but after a long…
Ralph Callaway
  • 24,529
  • 17
  • 112
  • 190
59
votes
5 answers

How can I get 'Recent Items' object Ids in Apex (soql) is it possible

'Recent Items' pane shows recently viewed records for the selected tab. The list is derived from your recent items and includes records owned by you and other users. Is there any way to get this in apex?
Prafulla Patil
  • 5,722
  • 10
  • 47
  • 67
59
votes
7 answers

How can I get a debug log for the sites guest user/public profile? [updated for Spring 18]

Normally, you can put debug monitoring on a user by name to see the details on the error they're getting (especially for the non-descript Error Loading a Visualforce Page). But when you are trying to debug a site page, how do you get a debug log for…
Shane McLaughlin
  • 8,678
  • 6
  • 44
  • 78
58
votes
2 answers

Apex List For Loops 101

I just have a simple question about how list for loops work that has been bugging me. Does the for loop variable refer to the actual list item? Here's what I mean: Say I have a list of accounts. List accountList = new…
Aaron P.
  • 1,667
  • 1
  • 15
  • 19
58
votes
6 answers

Can report data be accessed programatically?

Is there any way to access existing reports and their data to be used in apex? Sure, I could write the SOQL manually but if I want it to mirror a specific report I would have to make code changes anytime the report was updated. I don't think it can…
Ryan Elkins
  • 7,677
  • 10
  • 48
  • 77
58
votes
1 answer

How does Salesforce determine where to apply the "*** Skipped X bytes of detailed log" section in a log

Firstly, this question isn't about how to access missing log content when a *** Skipped 53353122 bytes of detailed log style message is encountered. That is covered in another question and revolves around altering log levels. I'd like to know when…
Daniel Ballinger
  • 102,288
  • 39
  • 270
  • 594
56
votes
6 answers

Deleting Triggers/Classes from Production

I was recently told ( Deleting a Class with IDE - cannot delete from Production? ): You cannot delete a class in production directly. You will need delete the class from your sandbox and then deploy the deletions to your production org. When…
AMM
  • 4,704
  • 15
  • 61
  • 113
55
votes
3 answers

Should we use process builder at all?

Forgive me if this isn’t an appropriate topic for this board but I would like to have an open and honest discussion about Process Builder. We have a multi-tenant org (different business units using the same objects with different logic) that…
Stephen
  • 1,551
  • 10
  • 13