A class is a template or blueprint from which objects are created. An object is an instance of a class.

learn more… | top users | synonyms

1
vote
0answers
9 views

Test method failure - expecting a DML error but not getting one

I have a test method that is failing because it is expecting an error, but isn't getting one. Here's the test method: static testMethod void assignToSelf_DmlError() { setup(); ...
0
votes
2answers
37 views

Test for a null pointer exception not acknowledged by SalesForce

I am doing some test code right now. In my Apex code I have a method that try-catches a DMLException and afterwards does a general Exception catch. In my test code I am successfully managing to test ...
0
votes
1answer
26 views

SOQL Object to Structure [on hold]

Say we have a custom object Object1 with many fields (fieldA, fieldB...fieldZ) and we want to select 3 of those fields into a structure/class Object2 with only 3 fields (fieldA, fieldD, fieldM). Is ...
0
votes
1answer
22 views

Error: Compile Error: Illegal assignment from Id to Opportunity at line 9 column 16

i am trying to pass opportunity id in to opportunity lookup in orde bt getting this error. can anyone plz help me. error-Error: Compile Error: Illegal assignment from Id to Opportunity at line 9 ...
3
votes
3answers
58 views

Force.com IDE Successful Deployment but No Change in Salesforce

I was able to successfully deploy a change via FORCE.COM + Eclipse. I wanted to delete an APEX class by updating the Status from "Active" to "Deleted". Force.com IDE told me the deployment was ...
0
votes
0answers
17 views

Delete Apex Class from Prodcution with Force.com IDE successful but still active in Production Environment [duplicate]

Hi I am trying to delete an APEX class in production using Force.com IDE. Steps/Results taken: 1. loaded apex class 2. updated status of Meta data xml file from "Active" to "Deleted" 3. Deployed to ...
1
vote
1answer
36 views

Delete apex class in Production with Force.com IDE

Hi I am trying to delete the following APEX class in production and I'm getting the following error. Steps taken: loaded apex class updated status of Meta datga xml file from "Active" to "Deleted" ...
0
votes
1answer
23 views

Error: Compile Error: invalid ID field: op.id at line 5 column 39

i am trying to get opportunity list id, but its giving this error. can anyone please help me out. public class Close_Date_Updation { public static void crUpdated(List<Opportunity> op) ...
0
votes
1answer
49 views

Replicate Account Record

I need help of mapping standard field in Salesforce. I manage to map the Billing address field. Unfortunately, I couldn't map such as Phone field. Could anyone help me please. The code that I am using ...
0
votes
0answers
33 views

Test class on User is failing [closed]

Test class is testing region adder trigger where trigger will update full country name to country ISO code and update Region__c based on country name (Geography__c) I created new user and kept all ...
0
votes
1answer
40 views

Method can't get values from SOQL query based on pagereference

I have those two methods inside my RSVP class : public LIST<News__c> getExcerpts() { String paramId = Apexpages.currentPage().getParameters().get('eventid'); return [SELECT ...
2
votes
2answers
59 views

Trouble creating test to cover code

I'm working on a trigger that will email users when a specific field is changed. I am having trouble creating a test class that will give me proper code coverage. I am new to this kind of thing so ...
1
vote
1answer
18 views

Error for Test Class on Controller

I have a pretty simple test class on a controller, which worked fine in my developer environment. However, I am now moving it to a sandbox and I'm running into an error: System.DmlException: Insert ...
2
votes
0answers
22 views

how to create wrapper class so i can show two list data in csv

Header title show proper but its data not showing in proper format because two repeat i have applied, i want work only with one repeat this is my class public with sharing class ...
2
votes
2answers
81 views

I used a class to update the records in account object but its show an error

public with sharing class NameUpdates { public list<account> display() { list<account>acc = [Select name from account limit 50]; list<account>accupd; ...
2
votes
1answer
9 views

cant find standard controller that is a custom class from a managed package

I have a VF page that calls a custom object from a managed package as a controller, so, I am seeing something like this: < apex:page standardController="mlk_MarksCustomObject__c" > I cannot find ...
1
vote
0answers
14 views

Turn on User TraceFlag from APEX Class

I am currently having difficulty to add a new traceflag from APEX Trigger or Class. Now, I've tried to use tooling API and using rest API call to activate a traceflag whenever new custom object gets ...
0
votes
2answers
36 views

Error: Compile Error: expecting a right parentheses, found 'sc' at line 4 column 99

This is my Controller global with sharing class treeInlineController { public String actId{get;set;} public treeInlineController(ApexPages.StandardController sc){ ...
0
votes
1answer
15 views

Help w/ test class for when task updated lead status

I am having some trouble with a test class for this code below. I am new to writing apex triggers and am lost on the text classes. Any help would be greatly appreciated. trigger UpdateLeadswithTask ...
0
votes
0answers
24 views

Direction in solving multi-object query

I am trying to build a trigger that does a few things and I was hoping I could get the best direction in handling this. I have 2 objects ("Quote" and "QuoteLine") and a custom setting called ...
-1
votes
2answers
33 views

If i change picklist value running to completed than my all parent status updated completed

Question Task 1: Trigger: 1. Create lookup field in contact object of contact, name as "Parent Contact". 2. Create picklist in contact name as Status with below values: a. Pending b. Running ...
-1
votes
0answers
26 views

Please Help a newbie create a test class for the following trigger

It's been a long while since I looked into written Apex triggers. I successfully created one a year ago but neglected to creat a test class for it which has now come to bite me in th ARS. If someone ...
4
votes
1answer
107 views

Call controller method from different class

How can I call a method structured like this: public with sharing class Calculator { private ApexPages.StandardController l; public Calculator(ApexPages.StandardController l) { ... } ...
0
votes
0answers
31 views

Constructor getting called twice and setting id as null in second call

I have a vf page and controller. When page loads my constructor gets called and on page load i have a actionfunction and settimeout of 0.3 second. I am unable to understand why my constructor is ...
0
votes
1answer
39 views

Need to update parent object field based on multiple child records [closed]

I'm trying to update parent object field based on all the records available in child object. I have two objects A & B. A is parent and B is child, A is having a Pick list field 'Status', B is ...
0
votes
1answer
38 views

Test class help for field history tracking

I am trying to write a test class for this trigger that keeps track of updates on the account object. I created a test class and in it created an Account with couple fields inserted, then updated ...
0
votes
1answer
30 views

Create Test in this following Controller [closed]

How to create a test class from this controller? public List<Event_Logo__c> getEventLogo() { con = new List<Event_Logo__c>(); con = [SELECT Id, (Select Id, Name, ...
1
vote
0answers
43 views

Methods defined as TestMethod do not support Web service callouts

i'm not using any web services then also error occur in test class. Please help for this : Apex Class : public class RequestPricingController{ public String oppId{get;set;} public Opportunity ...
0
votes
1answer
70 views

how to write a test class

I wrote a very short trigger, nevertheless, I cannot deploy without a test class, but I am not familiar with how to write one. Can you help me write a test class for this trigger? trigger ...
-1
votes
1answer
29 views

String value from a field of custom Object List

Please let me know how can I put a field values in a string from below List. oIncs = [SELECT Id , Name , No_Of_Transactions_abv__c , OwnerId , ...
0
votes
1answer
34 views

Workflow limitation on field update

Can I do Field update on a field with Logged in User ID? If not, please let me know a work around for that if possible. Thanks in advance!
0
votes
0answers
12 views

Contact Activity History - Filter

My goal is to create a page which can list the activity history of a Contact object but is also connected to another custom object. So there are 2 objects, Contact (standard) and Owner (custom). ...
0
votes
1answer
33 views

Not able to Send Email for Person Account

I am facing one issue and i don't know what is it, i am going to send and Email template to the Contact via Send Email Method but it will not working for Person Account...It is working for Business ...
0
votes
1answer
34 views

Code coverage for class run via Execute Anonymous

Hello and thank you in advance. I'm having a heck of a time testing my class enough to be able to implement into production. I've created a batchable class that I intend to execute via Execute ...
0
votes
0answers
48 views

Tests fail when creating community user

When our unit tests create a new user with the community license, the test fails with the following exception: System.DmlException: Insert failed. First exception on row 0; first error: ...
0
votes
0answers
20 views

Edit Email Template during the run

Can someone let me know how to replace "{!Compliance_Incident_abv__c.RepEmail_abv__c}" here with a parameter value passed to the method (not Using REGEX if possible)? I have an email template with ...
0
votes
1answer
36 views

Apex utility class for email send

I have below method to send email. Now I need to do the same from a separate utility class where I will have to pass toAddress , ccaddress , parameter string which has a map with Email template , ...
1
vote
1answer
33 views

How to generate a class diagram of Apex class or trigger in salesfore in easy way

How to generate a class diagram of Apex class or trigger in salesforce in easy way. If Any tool is available please suggest me.
0
votes
1answer
26 views

fillers string needed to fill the text document generated

Need to generate text files which contain data in multiples of 10. i can have 10 lines, 20 lines or 30. Using this code below. for(Integer i = 0 ; i < fillersToAdd ; i++ ) { ...
1
vote
3answers
124 views

System.Exception: Assertion Failed: Expected Test Class Failure

Below is a test class that is driving me crazy. I even tried deleting it via Eclipse but I cannot save to server because of this error. I keep getting the following error message: System.Exception: ...
2
votes
0answers
23 views

Code Coverage - Deleting Bad Test Classes [duplicate]

I have built two simple triggers, both of which cannot be deployed to production as they fail for a bad test class that has some broken SOQL in it. My current thoughts are to just delete the bad ...
-1
votes
1answer
41 views

Compile Error: expecting a semi-colon, found 'pageRef' on a @isTest

I'm getting compile error on line 6 column 22 on my test class @isTest public class ControllerProposalConvertViewTest { static testMethod void convert(){ Proposal p = new Proposal (p.Name = ...
-1
votes
1answer
41 views

Average test coverage only 13%. Need help on this @isTest Error: Compile Error: Illegal assignment

Trying to get a @isTest for this Apex Class. apparently, I only have 13% Average test and need 75%. Can you guys help? Even just lead me the right way. This is actually a convert button Proposal ...
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 ...
4
votes
1answer
61 views

Abstract Class Constructor: Possible to Inherit? [duplicate]

I have tried the following: public class OuterClass { abstract class abstract AbstractInnerClass { final Object member; public Abstract InnerClass(Object member) { this.member ...
0
votes
0answers
23 views

Insert Custom Object with Task in same DML call?

I have a trigger that creates a new custom object record when an Opportunity is Closed Won. I also want to create a series of tasks for this newly created Custom Object record but I don't want to have ...
1
vote
1answer
28 views

Use inner classes in another inner class

Apex classes can’t be static. And I also heard that 'all nested classed behave like Java static nested classes.' In this case it should be possible to refer Inner1 from Inner2. But it fails with ...
0
votes
1answer
46 views

Help needed : Code coverage is 37 %. wants to improve

class : public class SendEmailWithAttachmentsController { final Opportunity oppty; public String selectedTemplateId { get;set; } Quote__c quote = new Quote__c(); ...
0
votes
2answers
51 views

Need to cover test class with 75 %

Don't know why i am facing this issues in my test class to cover up the coverage with 75 %. I am getting only 18 % code coverage. Please Somebody help me out from this issues. Class : global ...
-1
votes
1answer
39 views

oldMap in Apex Class

I am new in apex coding and I dont understand map very well, I just want to understand what this code means.. Thank you in advance, please bear with me. public class sample_class{ public void ...