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
2answers
24 views

Error: Compile Error: expecting a colon, found 'oli.OpportunityId' at line 6 column 80

here i am trying to fetch opportunity lookup id from opportunityLineItems bt getting this error.- Error: Compile Error: expecting a colon, found 'oli.OpportunityId' at line 6 column 80 can ...
1
vote
1answer
15 views

Debug log shows data in list but Visualforce page is not displaying anything

In order to help HR manage license allocations for our HCM app, I worked up a proof of concept for a simple vf page that shows which users are assigned a specific permission set, and also are ...
0
votes
0answers
12 views

How to login and post project using codeshare?

I have been trying to submit a project in codeshare. There seems to be no login available in this page. Is codeshare still functional or is there any other site to submit projects for salesforce? ...
0
votes
1answer
13 views

Hide code in packages [duplicate]

I packaged a visualforce page and its controller but the code is still able to be seen. How can I hide my code? Thanks in advance.
2
votes
1answer
80 views

Nested IF Statements

We are moving to use X-Author to upload our planner information into Salesforce via their excel app. The excel spreadsheet has been set up prior and fields are pretty fixed. We are trying to map their ...
4
votes
2answers
308 views

How can I hide my code in visualforce page?

I developed my app, The controller is complete, and also the visualforce, but I need to hide my code at installing the app in another salesforce account. How can I make this possible? Is there any ...
1
vote
1answer
23 views

Configure Auto-Number with initials related to another object

I have an object called Project where stored the name of the project and its key, respectively: My Project Name, MPN Then I have a direct child object called Sprint followed by Issue where I have a ...
3
votes
0answers
37 views

Team Foundation Server as source control for Salesforce Project?

Does anybody has experience on using Team Foundation Server as source control for Salesforce project? We are currently using Git but management wants to start using TFS as source control going ...
-1
votes
1answer
37 views

Can't Get Unit Test Coverage Above 7/16 (43%)

I've hit a wall. I cannot find a way to get my test coverage above 7/16 (43%)! I feel like I've tried everything, but nothing seems to make a difference, unless it causes my test crash. Can someone ...
0
votes
0answers
16 views

Unable to re-deploy a deleted class which are causing low code coverage

I've looked for a similar case but I was not able to find any. I've deployed (deleting) in PROD a class which is now causing a code coverage of 33% and I'd need to restore it to have 75%+ code ...
1
vote
2answers
42 views

How can i increase code coverage test class?

I am new for test classes even I written test class it's covered 34% but I need to increase code coverage. Please can any one help me out how to increase my code coverage, please find below my apex ...
0
votes
1answer
26 views

FIXED: Code request: Pre-populate Oppty Name

I've received an ask to have the "Opportunity Name" standard field be pre-populated when creating a new Opportunity in the format of "Account.Name - TODAY()"; as to create a cleaner naming convention ...
1
vote
1answer
47 views

Indenting multiple apex code and pages

Is there any new tool to do code indentation for multiple Apex classes and vf pages at a single stroke?
0
votes
1answer
27 views

How to Test a Trigger — Test Passes But Doesn't Cover Code?

I've created a simple trigger that posts a user's field entries to chatter whenever they create or update a new record on the Weather Tracker custom object. It works. The problem I have is writing ...
5
votes
1answer
59 views

Apex Bug (?) Null Field Values of Cloned Instances Don't Persist?

I want to take the state of a source record, clone it, and apply the clone to a target record. But I'm encountering an issue in which a null field on the clone does not nullify the field on the ...
1
vote
0answers
48 views

Salesforce Integration from third party app

I'm making saleforce integration from 3rd party app, I made callout(rest API) and got response xml schema (xsd) format. I'm trying to generate apex classes from xsd, wsdl generation is not working ...
3
votes
2answers
224 views

Is this an abuse of ternary operator and inline SOQL or is this acceptable?

I have written a function like the one below to check if there is atleast one occurrence of a given Id in either of the two objects. I am having doubts on if I should use an if branch or use a ternary ...
0
votes
1answer
20 views

Compile Code Error Help

I keep testing Jeff Douglas' Dynamic search controller and I'm getting a compile error code. Error: Compile Error: Method does not exist or incorrect signature: ...
0
votes
0answers
21 views

Merge Leads Process Salesforce

I am creating a Merge Lead Counter on Leads, it is working fine at the moment but does not increment when a lead is merged more than twice or thrice. Can you explain what am i doing wrong. I have ...
-1
votes
1answer
91 views

Incompatible key type Decimal for Map

Any Idea on how to solve this error? Thankyou! Map<Integer,Map<String,Decimal>> BERYear = new Map<Integer,Map<String,Decimal>>(); List<Budget_Exchange__c> beList = ...
0
votes
1answer
48 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
52 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
221 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
91 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
35 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
103 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
64 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
71 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
93 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
29 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
57 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
104 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
546 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
79 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
48 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
174 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
224 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
195 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
136 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
17 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
51 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
821 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
32 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
172 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
487 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
82 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
98 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
893 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 ...