Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 29494

Questions relating to Apex, the native programming language for the Force.com platform. Use it for general questions on syntax, errors, constructs, and rules of use. Most questions should include a code *excerpt* to help answerers understand specifically what has gone wrong or why you need help.

14 votes
2 answers
138k views

How to convert string to Date in apex?

What is wrong with this format while am upserting the date in an object? Route__c r =new Route_c(); r.Plan_Date__c = date.parse(strDate); upsert r; In the debug log, I get the error as …
7 votes
2 answers
11k views

Retrieving an image from rich text field?

Have a rich text field called - snapshot__c which has image in it. This field is inside custom object called obj__c. obj__c has another field case__c using lookup in it. On a Vf page, I'm selecting …
1 vote
3 answers
8k views

Email not being sent from the apex code?

I am trying to send that variable in email body using apex code. … Messaging.reserveSingleEmailCapacity(2); // Processes and actions involved in the Apex transaction occur next, // which conclude with sending a single email. // Now create a new single email message …
2 votes
3 answers
704 views

Issue with code coverage in get & set methods in apex

The problem while covering the code is that the get method is not covering, while the set method covers. Example, below code covers (that's in blue): public void setselectedPlanRouteId(string Selec …
0 votes
0 answers
730 views

Image as a String in email method?

Code: Public void SingleEmailMessage() { // First, reserve email capacity for the current Apex transaction to ensure // that we won't exceed our daily email limits when sending email after // the … Messaging.reserveSingleEmailCapacity(5); // Processes and actions involved in the Apex transaction occur next, // which conclude with sending a single email. // Now create a new single email message …
3 votes
1 answer
1k views

How do I stop the loading indicator on the VF page?

I have single field called Case and on its onchange event along with the apex method, it calls the JavaScript function where the loading indicator can be seen on the VF page like below: Till here the …
1 vote
1 answer
294 views

How to fetch custom object's record details using case?

I'm trying to fetch the custom objects record details and display on the VF page with below code. In my case, I have case lookup with a custom object (say, Evaluation__c) and my requirement is - ope …
0 votes

End Point URL Error in HTTP Class?

At one point of time, I had a similar issue of HTTP/HTTPs while using within the Salesforce environment and it was painful at some point of time. From my experience and what @erkan has mentioned, I …
Viraj's user avatar
  • 568
0 votes
Accepted

Incorporating image in Email Template

Open the documents. Open any document (image), right click and copy the image address/url. Now, create the image tag: For HTML: <img src="https://asec.cs1.content.force.com/servlet/servlet.ImageS …
Viraj's user avatar
  • 568
2 votes
0 answers
2k views

How to add image in email template dynamically?

I have a letterhead that I'll be using for different Email template. On VF page, I have a button which will take the screenshot of the page and store in a rich text field in a custom object. The scre …
-1 votes
2 answers
712 views

How to pass the array values from the javascript to apex controller and later store in custo...

I am trying to get the values from javascript which is in array, to the apex controller and later save it. When I check the debug logs, I see null value in it. Need help. Below is my code. … Below is the code for VF, JS & Apex. VF code I have:- <apex:form> <apex:actionFunction action="{! …
-1 votes
1 answer
530 views

How to prevent postback in VF page?

On click of a button, I want to prevent postback so that the page does not refresh. I tried with below but doesn't prevent from postback. Any help? <div> <button type="button" onclick="return fa …