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
28 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
48 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
30 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
152 views

Help for writing a trigger

I need to write a trigger:- A task should be assigned to a account on account creation if the reporting country of account owner is united states. I have written the code partially, but geting stuck ...
1
vote
0answers
90 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
87 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
44 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
793 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
1answer
138 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
100 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
350 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
227 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
699 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
80 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
507 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
110 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 ...
3
votes
1answer
331 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 ...
8
votes
4answers
923 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
138 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
297 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
2k 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
2k 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 ...
10
votes
2answers
118 views

Incomplete code blocks vulnerability

I've submitted my application for Security Review and I've got this problem in the report. I'm not sure how to fix it. Let's see the First case: I have some classes that don't have any code like ...
3
votes
4answers
1k views

Code Formatting

Has anyone gotten code formatting (Ctrl+Shift+F) to work in Eclipse? I know it's basically a Java feature but it would be neat to format Apex code according to rules. I also can't get some hotkeys ...
1
vote
1answer
574 views

Using RegEx Pattern Match to create DateTime fields in trigger

How do I write code with the correct syntax to run a pattern grouping match within a string, then replace the pattern groups found in the result so that they follow a desired pattern? I've never done ...
9
votes
3answers
1k views

Verification code - when is it asked?

I've read a lot of docs for this and I'm not completely sure of what are the conditions for the login verification code be asked. Can someone please help with this question and clarify me? Thanks
0
votes
3answers
878 views

Code Coverage on Triggers - no coverage for IF…TRUE?

I am woefully lacking in my Class writing skills. I'm curious if anyone can tell me (or give an example that works) why I cannot seem to get many, if any, IF...TRUE statements to be covered by Code ...
0
votes
1answer
428 views

Code Coverage on Triggers - color coding

This is probably overly obvious, but I do not wish to assume, and I am finding no reference anywhere: What does the COLOR CODING when viewing percentage coverage on a Trigger mean? Some code is ...
6
votes
3answers
512 views

How can I rewrite this method with efficient SOQL queries

public List<phonesterDat> getCompanyData() { List<phonesterDat> var1 = new List<phonesterDat>(); for (Keyword__c keyword : [select kw__c from Keyword__c]) { phonesterDat var = new ...
3
votes
3answers
2k views

Passing list from Controller to VF page

I'm trying to pass a list from controller to page and use it in Javascript as an array to form html content. But, when I pass a list of objects, an exception is thrown. Uncaught Syntax error : ...
3
votes
1answer
816 views

Code Coverage question

I saw for the first time in one of my orgs where there is a 29% (61/208) what does that number in the brackets say ? I have never seen it in any other org. Is this a new release for winter 13 or has ...
19
votes
1answer
586 views

What's the best way to check if person accounts are enabled via Apex Code?

I need to be able to check if an org has Person Accounts enabled via Apex Code as part of package. What's the best way to do this without making the package require Person Accounts be enabled in any ...
2
votes
4answers
2k views

How to print a quote or invoice from salesforce

How do I print a Bill, or an Invoice on a custom object on the click of a button. Things I've thought of Printable view : it does not give me the control to change the formatting Visualforce Page : ...
17
votes
6answers
8k views

Copying metadata and code from one Production org to another

How do I copy(for want of a better word) metadata (i.e. Objects, Workflows, Validation rule etc), and code (Apex, Visualforce, Triggers) from one Production org to another production org? Is this ...