Skip to main content

Questions tagged [salesforce-apex]

A proprietary Java-like programming language for the Force.com Platform.

-1 votes
1 answer
64 views

I'm looking for some guidance. I have created an Expense Tracking App, where my custom object is called Expense__c. It has the ...
Nazareth Alvarado's user avatar
0 votes
1 answer
171 views

I had a scenario where I needed to sort a list of EmailTemplate, but didn't have anything to sort the list by (other than a common number in the ...
Jessica's user avatar
  • 910
0 votes
2 answers
121 views

I have this controller and some test cases. Any corrections/advice are appreciated to make them better. ...
Deja Bond's user avatar
0 votes
1 answer
103 views

I am relatively new in making (invocable)callouts. My main concern is if I should be using smaller parts for example for the body and using a query only once in this case. Any suggestions would be ...
Thomas's user avatar
  • 103
-2 votes
2 answers
135 views

We have specific Email2Case emails that come in that we just want to delete. Below is a simple APEX trigger that I think will do the trick. ...
Gunner1714's user avatar
1 vote
2 answers
169 views

Could you please correct me if I'm not following best practices or code optimizations? It is working fine in test environment planning to deploy. Trigger does two tasks: Gives an error when trying to ...
Sri's user avatar
  • 11
0 votes
1 answer
390 views

This is my first salesforce code. It seems to me there is too much data lookup but I don't know enough about saleforce apex coding to say. The purpose of the code is to set the entitlement based on ...
DaveB's user avatar
  • 103
4 votes
0 answers
143 views

The code below is a controller for a Visualforce page (form). The controller determines if the form was previously created and saved or saved in progress in a previous action. If the form is new it ...
user2355809's user avatar
1 vote
2 answers
133 views

Please review the following salesforce trigger code ...
Adamo's user avatar
  • 185
2 votes
1 answer
387 views

I hope this is the right board for this. I am a novice programmer and I am trying to learn how to write better code. I have a visualforce page with a very long Javascript script in the middle of it to ...
MRG's user avatar
  • 133
3 votes
1 answer
126 views

I am trying to search account table by providing a search string. I am building a query based in different conditions and then adding the returned records in a list. The functionality is working ...
C0DEPirate's user avatar
2 votes
1 answer
127 views

I have the following APEX code. I have been trying for hours to try and refactor it so that the SOQL query is outside of the for loop without any luck. Any ideas? ...
watzon's user avatar
  • 173
1 vote
1 answer
99 views

This is called from a VF page, styleClass="{!IF(isWindows8Device, 'windows', 'not_windows')}" So if it's a windows device, return true. The best thing to do ...
Daft's user avatar
  • 113
2 votes
2 answers
823 views

I had posted a question some time back for the best way of doing an account hierarchy, and this is the way implemented at last. Can someone point out any obvious flaw in this (other than SOQL)? The ...
sfdc99999's user avatar
  • 121
4 votes
1 answer
196 views

I was refactoring some code and found this: ...
Andrii Muzychuk's user avatar