Code indicates that a question is to do with pages, controllers or similar, and not the declarative aspects of the platform.

learn more… | top users | synonyms

1
vote
1answer
7 views

apex visualforce code review

Are there any tools which can be used freely to review apex and visualforce code written and provide some suggestions about code improvement and applying best practices. I need to check quality of ...
0
votes
1answer
42 views

Q: Need to add a list but not sure were in the code

I have a Visualforce page. When you selected a product. I need the "OpportunityLineItem.ListPrice" and "OpportunityLineItem.Terms_c" fields to show the value. The only way I can get the system to show ...
5
votes
4answers
2k views

96% code already used. How to manage it?

We are using a developer sandbox for development. When i go to System OverView > Business Logic > Code Used, i see that we have already use 96% of the amount of code we can write. Can we get it ...
5
votes
2answers
112 views

Is there a more efficient way of getting an object by related list?

I've started programming in Salesforce in January 2015. Most of my code uses this methodology : : List<String> accountIds = new List<String>(); for(Account account : accounts) { ...
0
votes
1answer
14 views

Split functionality for consecutive occurence

I have below code snippet for making immediate letter after space in capital. But this fails for consecutive two spaces and throws error. Can some one guide me here? List<String> ...
0
votes
1answer
14 views

When Activity Inserted by a User that matches User Lookup field on Account, The Date of the Activity is Put in CE_Last_Activity Field on Account

I have a trigger where I'm trying to make it work like the following: When a Activity record is inserted by a user that matches the value in a user lookup field on Accounts named "Customer Success ...
1
vote
2answers
28 views

Need help adding an Apex Class to a visualforce page

Ok, so I need to add an apex class to a Visualforce page so that the page can have an extension to make it more functional but unfortunately, These are the only options on the Develop Menu. API ...
2
votes
2answers
167 views

How to make triggers not fire when we use API tools like Data Loader?

I have written and deployed a Contact Trigger in our production environment, and whenever I would have to use Data Loader to mass update contact records, I would always have to go into the code and ...
1
vote
1answer
29 views

Should this be a trigger or is there another option I'm missing

I have a list of 41K zip codes that are all are connected to a DMA. The business would like to enter in a zip code and then based on that value automatically return the DMA value in the Market2__c ...
-1
votes
1answer
27 views

Incompatible value type Object

I am getting the following error while adding elements to a map. Error:- Incompatible value type Object Code:- public class CR_Report{ public void Completed_CR_Report(){ //Compare old zip ...
0
votes
1answer
97 views

Test Coverage for a Email Services Class

Class: global class EmailDemoReceive implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.Inboundenvelope ...
0
votes
1answer
49 views

Trigger does not work but there is no error message

I have a trigger that is supposed to work like this "If an account has a case attached to it with a Customer Save record type then the LE_Status__c field on the account is updated to "Red". It is not ...
0
votes
2answers
37 views

Apex Trigger on Account working properly in Sandbox but does nothing in Production

I have written a few triggers for my company's org, all seems to be working correctly except one on Account... It was working for the last few months and just today, I have noticed that it stopped ...
2
votes
3answers
301 views

Workbench Rest Explorer Apex Code Coverage Query - Wrong Results

I ran a query in REST Explorer ( on ApexCodeCoverage ). Im getting duplicate (and wrong) results. Few classes/triggeres are repeated with different results. A class ApplicationInfoHelper is being ...
0
votes
1answer
34 views

Visualforce Page useful information

I am new into apex development and I need to learn as much as I can. The best way for me to do so is if i can lay my hands on apex examples or just detailed explained code. So I would love if the ...
1
vote
1answer
149 views

Test Class for Custom Controller

I'm having trouble writing a test class for a custom controller used in an VF page. The goal is a UI allowing the creation of multiple records for a Custom Object Time_item__c. Everything works as ...
0
votes
2answers
119 views

trigger to populate Contact lookup on custom object

I have a custom object, Deal_Reg__c. On this object, i have a Contact lookup field, Submitter_Contact__c. I would like the trigger to populate this Submitter_Contact__c field. The trigger will fire ...
2
votes
1answer
52 views

An Opportunity Trigger working in Sandbox (no data) but fails in Production :(, please help!

Thanks again for all the help I have received from the past, this community is awesome! :) I have written the code below and for some reason it works in Sandbox but fails in Production when I try to ...
0
votes
1answer
47 views

Approval Matrix using custom settings and its method

Could you help me with my method for my approval flow? I created a custom settings named Approver_Matrix . Here is a sample: Note: Private Account and Public Account fields were checkbox. For my ...
1
vote
2answers
191 views

How can i pass my object ID to my VF page using a custom button?

I have a custom object, Deal Registration, that can have a list of Products added to it. I create a junction object DealRegProducts. While on a Deal Registration, the user would scroll to the related ...
1
vote
2answers
44 views

Can you Help me with Code

Public static void opptyownermanagerupdate(Opportunity[] Opptylist) { List<Opportunity> Opptylists = new List<Opportunity>(); List<Opportunity> opptyToUpdate =new ...
1
vote
1answer
26 views

Account Trigger with Contact 'for' Loop error

I am relatively new to building Apex Triggers and need some help. Trigger's Purpose: The Account Triggers purpose is to throw an error message if there is no contact associated to the Account upon ...
7
votes
3answers
271 views

Detecting dead code in Salesforce

In Java, there are several effective tools for detecting dead code like CodePro. I have tried but probably they won't work for Salesforce project. It is not usually an easy job to figure out the dead ...
1
vote
2answers
101 views

Need help with test class for my first trigger, have researched!

I am new to apex and SF and need help in writing a test class for my trigger. This trigger runs every time a Calender event is created and updates the scheduled date and status on Opportunity. The ...
1
vote
0answers
47 views

Extact Target- Import subscriber to data extension using C# [closed]

I want to move the newly subscribed/unsubcribed users from my web application to Exact Target system daily.I have a CSV file exported from my web application.I want to import this CSV file to Exact ...
5
votes
2answers
862 views

Best version control for salesforce -eclipse and Mavens mate

Which is the best version control for force.com projects. Currently we are not using any version control and we are planning to follow some practices. We predominantly use eclipse and Mavens mate. We ...
1
vote
0answers
87 views

Not getting Activation Email link from Code @ Exacttarget

I signed Up a Developer Account @ Code.Exacttarget, but it is not sending first time activation link to mail Id. It says wait for minutes, but it's been 3 hrs I haven't got link.
2
votes
1answer
54 views

Code coverage too low

I created a class the will return set and get the parameter to rest service here is the class public class LeadUtils { public String First_nm; public String Last_nm; public String Phone; ...
2
votes
3answers
116 views

AMPscript variable question - how would multiplying them work

I am putting together a script that pulls information from multiple data extensions. I have completed the code for one data extension but I am not sure if I just need to duplicate all the variables ...
1
vote
1answer
38 views

Retrieving User information via API/Programatically

Can some one please let me know how to obtain the following information for a user programmatically or via API: : Token Client_Id Client_Secret We need to do this through a secure connection. ...
1
vote
2answers
168 views

Help for writing a trigger

I need to write a trigger :- A task should be assigned to an account on account creation if the reporting country of an account owner is in the United States. I have written the code partially, but ...
1
vote
0answers
220 views

Custom Button Using Search Functionality

I have a project I'm stumped on. I'm adding a detail page button that uses the search functionality to create a Find Duplicates Button on Contacts. Below is the code I'm using. I'm getting the ...
0
votes
2answers
98 views

Lack of Apex code Coverage

I'm trying to get a code to work that will set map an opportunity owner to the account owner but I'm getting failures for two lines. Any ideas? Broken lines start with a "**" trigger ...
2
votes
2answers
124 views

In System Logs what does the false|true mean for Variables

There's a lot I don't understand about the Execution Logs from Salesforce. Maybe some of it is just my limited programming experience (Apex mostly, smattering of Python). I feel like there must be ...
0
votes
2answers
2k views

Test Code for Apex Trigger

I am new to writing code and I spent some time writing the below trigger - now I get a code cover error when I try to move it to Production. I've tried writing some test code but can't get it right - ...
4
votes
2answers
300 views

Ctrl Click doesn't work in Force.com Ide?

I get used to ctrl+click code assist which would find the declaration of a variable/class/method in Eclipse, Visual Studio, Borland\Embarcadero Delphi. It is an extremely useful feature when dealing ...
1
vote
2answers
153 views

Use Shared Code For 501 Programming Assignment Exam

The new programming assignment is coming, can i use official shared code to complete the task? like: developer.force.com/codeshare or Smart Factory or Apex Enterprise Patterns or Flow Factory
1
vote
1answer
625 views

Connection between AWS(AMAZON WEB SERVICE) SES and sales force using apex code to send file attachment

public with sharing class AWS_SES { public String endpoint = 'https://email.us-east-1.amazonaws.com'; public String method = 'POST'; public string key; public string secret; public ...
0
votes
2answers
295 views

How apex get Executed

i write a Batch apex.i write an execute method .which is using a static variable of another class.because it is shhared.any one can use it and change it. public void execute(Database.BatchableContext ...
2
votes
2answers
975 views

Get the ID of Particular record on click of edit from List View page

I am opening one VF page on click of edit fo lis view of particular object. Now I want to get the id of that particular record which I edited. I am writing this code but its throwing this error. ...
2
votes
1answer
94 views

Structure and fuction for picklist's values

I'm tring to optimize the code below. I'm looking for a structure where i can put the picklist's values and after (with just a condition) i want check the condition for all the values in the ...
1
vote
2answers
2k views

Trigger to update Account from Case field

Every time I think I have got these triggers figured out I have to create something new and I am stupid all over again! This time I have to update a field on the account with either 'R', 'Y' or 'G' ...
3
votes
1answer
741 views

Can abstract classes have non-default constructors?

Abstract class: public abstract class FilterCriterionAbstract { protected Object leftComparableElement; protected Object rightComparableElement; public FilterCriterionAbstract() ...
2
votes
1answer
126 views

Code Coverage - Blue versus Red

I have various ranges of code that never show as "covered" in Apex Tests. Here are two examples. Could someone give me some guidance on them? How would I cover them? One: ((Just the ...
4
votes
1answer
480 views

Fuzzy Matching for Duplicate Address Checks

A good duplicate checker - for checking if the same address has already been entered - needs to take into account misspellings or spelling variations. We have implemented our own APEX methods which ...
9
votes
4answers
1k views

Source control tool for Salesforce development

I am looking for a source control tool like Github which can do the following for us. Provide a cloud based source control repository like subversion, etc. Provide web based view to track changes. ...
2
votes
1answer
234 views

Queue Color Modifications

Our inbound emails are worked out of the Service Console. Messages coming in will end up in a Support Queue and then escalated/passed to different queues or technicians when appropriate. We receive ...
1
vote
1answer
442 views

Getting revised map <id, string> data back into original list under same id

I seem to be having difficulty getting data from a map back into a list so that it corresponds to the correct Id and field it was originally associated with after it's been modified in a trigger. For ...
9
votes
2answers
3k views

Visualforce and Apex Theme for Notepad++

Are there complete themes for Visualforce and/or Apex for Notepad++? Ideally with autocomplete for all parameters and methods and code highlighter? I made custom a theme for Visualforce only but ...
4
votes
1answer
3k views

Structure for classes to call inner or sub classes

I don't have a Java background and am working on a class where I'd like to be able to call inner classes from withing methods of the outer class. As much of Apex is implicit and I'm still learning, I ...