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

0
votes
1answer
11 views

downloading event log file from apex code [duplicate]

Can we download the event log file directly from apex code.(i.e., without using rest explorer/webservices manually.Everything should be written in Apex code only). Regards, Sravika
0
votes
1answer
41 views

I am trying to understand code coverage in Salesforce

I have read several blogs, but wanted to clarify few things. Is code coverage calculated for each class or over for the entire org? Does it include the code coverage of managed packaged? During ...
2
votes
1answer
85 views

Dynamically serialize or deserialize properties in apex

I want to have dynamic properties in my JSON structure, something like this - { "payload": { "one": { "x": 1 }, "two": { "x": ...
2
votes
2answers
44 views

Changing Oppoturnity Owner to a Lookup User Id field on the Opp Object

I want to create a trigger on the opportunity object to change the opportunity owner (if their profile is a Service Engineer) to the field called "Sales Rep Owner" which is a lookup user field on the ...
-3
votes
1answer
26 views

Trigger Test Class code coverage not increase over 29

I have written the trigger below trigger CreditrequestTrigger on Credit_Request__c (after update) { String body = ''; String subject = ''; List<User> Userlist = new List<User>([SELECT ...
2
votes
1answer
76 views

Trigger for counting child records via roll up summary relationship

We have a Destinations object which is linked to Supplier products object via a lookup relationship. There are two types of supplier products(marketplace and curated) We want to count the number of ...
3
votes
2answers
27 views

Email Alerts to Customers using Work Flow processes

Creating a work flow email alert. Would like to send out to customers email found in opportunity under contact roles. Currently, the only options are to select from drop down recipient type. Is there ...
1
vote
0answers
35 views

Are there any automated Apex refactoring tools?

With reference to a Stack Overflow question from 2009... In the last six years, have any automated Apex refactoring tools been developed? I'd like to do simple refactorings like "extract method", ...
1
vote
1answer
55 views

Apex Code Coverage - need help with constructing Apex Class test code

I am looking to complete the Code Coverage requirement for deploying Apex Classes. I have taken the inbound email class that Salesfoce has made available for use with custom objects, but now I need ...
0
votes
1answer
16 views

Template changes font code when editing

I have created a template from different content areas based on free format. The problem I have is that at first all the content is charged on the template but when I want to edit the content of that ...
-1
votes
1answer
47 views

Code coverage help! I need help writing the test class for a trigger

My issue is that although my test class (below) passes, I am getting 0% test coverage on the trigger. Not sure why?!! Below are my trigger and test class: Here's my trigger: trigger ...
1
vote
1answer
64 views

Casting 0.00 decimal fields to null check in APEX

I'm working on standard page and what is the best way to cast any 0.00 to null check? I have a situation where I want to check to see if the decimal value is 0.00 but is that consider to be a best ...
3
votes
3answers
241 views

Getting dynamic Record Type name/id

Is there a way I can find out what recordType the user have selected? I have put together the apex code : private String getRecordTypeSelectedId(String recordTypeName) { String rtId; ...
1
vote
1answer
27 views

Is there a way to capture what RecordType user has picked using apex code

I have few different record-types in my object and I like to know either by Id/Name what record-type the user have selected and based on that record type selection I have to perform some logic behind ...
-2
votes
3answers
43 views

Updating a field which is a lookup on ather custom objects

UPDATE 3 Here is my complete code I have so far; I have trigger on vendor__c object trigger vendorTrigger on vendor__c (after insert, after update) { vendorController vencont = new ...
0
votes
1answer
44 views

“expecting a colon” where clause

As you see that I'm calling doQuery() and I'm instantiating object and creating a record and as soon it creates a record I'm getting the ID and once I got the ID I'm querying again to get the Name of ...
1
vote
2answers
103 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
123 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
124 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
15 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
16 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
42 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
432 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
31 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
106 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 ...
1
vote
1answer
277 views

Test Coverage for a Email Services Class

Class: global class EmailDemoReceive implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.Inboundenvelope ...
1
vote
1answer
66 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
64 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
569 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
39 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
492 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
171 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
61 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
82 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
255 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
48 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
35 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 ...
8
votes
3answers
387 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
160 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
54 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 ...
6
votes
2answers
1k 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
119 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
61 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
145 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
43 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
172 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
270 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
99 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
173 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 ...