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 65383

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.

0 votes
0 answers
127 views

Attempt to de-reference a null object but no issues found in the class

I have a Class1 and then there is another Class1_Handle. The Class1 takes a list of OPP, then loops through that and sends Opportunity ID to the Hadelar 1 by 1. The Handler then does a bunch of stuff, …
Simple Code's user avatar
0 votes
1 answer
1k views

How to set StatusCode on Test.setMock [duplicate]

I have a simple class that just calls the generic HTTPCallOUt method for its test class. I want it to be able to fail in order to catch all the code. Here is my code: Test.startTest(); Test.s …
Simple Code's user avatar
0 votes
1 answer
331 views

Displaying Related Documents OF A Custom Object in VisualForce Page Salesforce

I have to use some Apex to fets the data from the junction object. Here is what I have so far to accommodate this but its not working, I get nothing in return from this code. … MyDocs}" var="item"> <apex:relatedList list="item.AttachedContentDocuments" title="test" /> </apex:pageblockTable> </apex:pageBlock> </apex:page> APEX: public class DocsLoad{ …
Simple Code's user avatar
2 votes
3 answers
6k views

IF with && and || condition SalesForce Apex

I have a trigger that checks the stage of an OPP before it updates. What I want to do is check if the new Stage is 'X' then the Old Stage is not 'Y' or 'Z' there could be 4 more stages, so if a new st …
Simple Code's user avatar
0 votes
1 answer
259 views

Creating Button Dynamically using JavaScrip

On page load, I am calling a function from the Apex class in a loop. Here is my Code on VFP: <apex:page controller="Controller" action="{! … add}" escape="false"></apex:outputText> </apex:page> My Apex Code: public class Controller { public string recordId {get;set;} public string add {get;set;} Public Void LoadData() …
Simple Code's user avatar
0 votes
0 answers
98 views

Help Understand Salesforce Governor Limit and Apex

I keep getting an email that goes like this: Caused the following Apex resource warnings: Number of SOQL queries: 62 out of 100 Initially, I moved the big Database calls to an Apex using Apex Action … So does that mean if I call an apex class from within the flow is still tied by the rules of Flow Governance? i.e. only 100 Queries compared to 200 in apex? …
Simple Code's user avatar
2 votes
1 answer
3k views

Error: Unsupported field type called "Text (Encrypted)

Actual formula : IF(LEN(CODE__c)==0,0,1) Error: ' You referenced an unsupported field type called "Text (Encrypted)" using the following field: CODE__c' Can we use apex class to check this instead? …
Simple Code's user avatar
0 votes
1 answer
751 views

How to change FileName in Trigger | APEX [closed]

Please let me know what else I can do or if there is another way of sending an Email from Apex and grab every attached file related to that record without having to know the name of the file. …
Simple Code's user avatar
1 vote
1 answer
4k views

SOQL to Search by Record Id without sObject

I want to be able to run a SOQL query in Apex Trigger to gather data using that RecordId. …
Simple Code's user avatar
0 votes
1 answer
417 views

Track Customer response on Cases Salesforce

I looked high and low but I couldn't find a single idea on how to do this so I am asking here. I am looking to solve the following problem: We have status on cases, in this status list we have to "wai …
Simple Code's user avatar
2 votes
Accepted

ContentVersion to File Attachment in Email | APEX

Okay I figured it out, I was using a SingleEmailMessage object, and according to this documentation I have to add an attachment using the following code: email.setFileAttachments(new Messaging.EmailFi …
Simple Code's user avatar
0 votes
1 answer
4k views

ContentVersion to File Attachment in Email | APEX [closed]

I am trying to get the Blob Version Data from the ContentVersion in Apex class and send it in an Email using the Following Code: Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); …
Simple Code's user avatar