Questions tagged [salesforce-apex]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
50 views

Tests for Salesforce controller concerning candidates and notes

I have this controller and some test cases. Any corrections/advice are appreciated to make them better. ...
0
votes
1answer
65 views

Invocable callout(Post) from processbuilder

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 ...
-2
votes
2answers
68 views

Salesforce Delete Case based on Subject

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. ...
1
vote
2answers
107 views

Trigger corrections

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 ...
0
votes
1answer
57 views

Set the entitlement of a case based on record type

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 ...
4
votes
0answers
110 views

Salesforce controller to implement a dynamic form

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 ...
1
vote
2answers
104 views

Last three values sfdc trigger functionalty

Please review the following salesforce trigger code ...
2
votes
1answer
237 views

Displaying multiple Google Maps markers on a Visualforce page

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 ...
3
votes
1answer
94 views

building a search functionality

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 ...
2
votes
1answer
88 views

Refactoring APEX to keep all database calls outside of for loops

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? ...
1
vote
0answers
86 views

Salesforce Report that searches long text fields, has customizable view, easy to update, etc

I got really tired of how ugly and inflexible Salesforce Reports are. So I made this Apex/Visualforce combo that searches long text fields, makes adding and removing fields a snap, has a customizable ...
1
vote
0answers
92 views

Salesforce Trigger Logic

The following code is inside a before insert / before update trigger. Essentially what I have in our app is that when a request type (request.Type__c) is chosen, the scheduler (request.Scheduler__c) ...
1
vote
0answers
805 views

HTML to plain text converter

Please, review the code below. Test class: ...
1
vote
1answer
73 views

Detecting Windows Phone and Tablet clients

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 ...
2
votes
2answers
647 views

Account hierarchy

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 ...
4
votes
1answer
145 views

Format current date

I was refactoring some code and found this: ...