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
1answer
20 views

Inactive Trigger Test Code Question for potential solution

I was reading this: Are inactive triggers counted against test coverage? And I had an idea pop into my head: Can I cover several apex triggers, using a single test function, if they all contain the ...
0
votes
0answers
13 views

Send mail to Queue members using Apex [on hold]

I have multiple Queues and I need to send emails to specific queuemembers on update of case based on some conditions. I am not updating Case Owner,Only need to send mail to queue members. Please ...
0
votes
2answers
27 views

Need to increase code covergae [on hold]

I have 61% coverage i need to increase saveAccount() method. public with sharing class AccountCustomLookupCntrl { public Account account {get;set;} // new account to create public List<...
0
votes
1answer
26 views

Determine if Record is New Record

I am trying to insert a condition to check if a record is a new record vs. an existing record in a trigger, but I'm not sure how to incorporate it in my condition? I'm sure it's fairly simple, I'm ...
0
votes
2answers
17 views

Find Duplicate records [on hold]

I have a doubt on apex class. I don't know how to check duplicate records while inserting record via VF Page. Anyone Please help me for this doubt. Thanks.
0
votes
0answers
18 views

Metadata API: Updating a picklist value to make it visible for selection on record types

Was able to implement the Metadata API using @future to make asynchronous callout via an Account Trigger to add picklist values to a custom picklist field on the account. However, it is added to the "...
0
votes
0answers
40 views

Insert class not working

I created a class to insert Account List record. The condition is allow duplicate Account List name, but the owner is different from the existing record. Example: Exisiting record: Account List ...
1
vote
2answers
32 views

convert hex value to integer

I am working on a method defined in a class that controls the lead object. The desired end result is to produce a unique number for each Lead record. I currently have this working, but the out put is ...
-1
votes
1answer
49 views

Insert logic to avoid record with duplicate name and owner, but allows duplicate name with different record owner [on hold]

Can somebody help me with the logic on the following: Account List name is existing, but the ownerid is not existing (Different user) -> insert ok Account List name is not existing, but owner id is ...
0
votes
2answers
52 views

Class test for Trigger to match a field in object A with object b and populate a relationship lookup in b

I need some help to create a test class to validate the trigger down, someone help me? I do not know where to start, I've tried to get some example and build the class but I could not, yet Trigger ...
0
votes
1answer
23 views

Getting an error “Attempt to de-reference a null object”

I have a custom button which I am trying to work with. But i keep on getting error " Attempt to de-reference a null object Error is in expression '{!updateDb}' in component in page ...
1
vote
1answer
64 views

Delete class not working

I created an apex class to delete Account List record which has no Account List Items when I execute the class, it's not deleting the Account List with no Account List Item records. Objects involved. ...
3
votes
1answer
60 views

find out dependent fields, object and classes in salesforce

I want to know class is dependent to which class, object, and Field. I have tried to retrieve data from SymbolTable but it doesn't show me dependent Class Name or ID. Is there any another way to ...
1
vote
1answer
21 views

Page message show in apex page

I have a VF Page where Add button helps to add rows. If an input field value of first row matches with input field of the next or any later row's field value, system will show page message only on the ...
0
votes
1answer
16 views

Test Class for SchedulableClass

How can I write a test class for this scheduler class: global class AccountRevenueSchedulable implements Schedulable { private static final String EVERY_JAN_1 = '0 0 5 1 1 ?'; //every Jan 1 at 5:...
4
votes
1answer
153 views

Possible to declare static constants in an inner class?

I want to define an outer class with two inner classes, the inner classes containing specific constants related to each of them. For example: public class Stuff{ public class Letters{ ...
1
vote
1answer
49 views

Testing InvocableMethod

so basically I ripped off http://www.iterativelogic.com/using-invocable-methods-with-skuid/ in order to integrate an automatic Lead Convert Method that can be called from Skuid and I'm unable to test ...
12
votes
4answers
655 views

Why use an interface in Apex?

I'm studying for my Platform Dev I exam, and I've been reading about interfaces. I understand how they work in abstraction, but what I don't understand is why you would use them. The documentation ...
2
votes
3answers
74 views

How to get a list of Test Classes in an org

I need to get all test classes (classes with isTest Annotation) in an Org.. Is there anyway to filter test classes out of all the Apex Classes
0
votes
1answer
59 views

Boolean variable not checking

I'm trying to write a scheduled class that ticks a check box if it's unchecked, and if it's checked it un ticks the box. What is it that I'm doing wrong with my code? Thanks in advance, I am a ...
0
votes
1answer
29 views

Testclass to check date change

I have a trigger that changes a date field based on activity on related object. The trigger works fine but the test class that I created didn't work and has 0 coverage. So basically, if there is a ...
0
votes
2answers
27 views

Use custom field from custom object in class

I am creating an Apex Class using eclipse and trying to use a field. I have created a custom object called Credit_Insurance__c and a custom field named Credit_Insurance_Status_c. When I try to use ...
2
votes
2answers
32 views

test class fails system.assert but manual upload performs as expected

I don't understand why when i upload the two invoices in my test class through the data wizard they perform as expected based on the triggers I've written. but when i run this test class it fails due ...
0
votes
1answer
38 views

Compile Error: expecting a map literal assignment, found ',' in nested map put values

I am compile error as in subject line for below code. Can someone please help me? Apex Code Snippet for(iterator=0;iterator<(cd.size()/2);iterator++) { answerchoices.put(sq....
1
vote
1answer
56 views

Amend a SOQL query

I'm trying to amend my code to change one of the fields that appears in an email. I no longer wish for the BMCServiceDesk__IncidentResolution__c field to appear in an email. I understand how I could ...
0
votes
1answer
28 views

Attempt to de-reference a null object - Error in sorting list

I am getting subject line - error while I try to execute below apex code snippet Apex Code Snippet for(Integer index = 0; index < surveyInstanceList.size(); index++) { Survey_Question_vod__c ...
0
votes
3answers
39 views

Modify collection during iteration

I have below code where I need to modify the List during iteration. It throws error. can someone suggest a way out in this case? **Error ** System.FinalException: Cannot modify a collection while it ...
4
votes
0answers
31 views

Enable Apex Classes - Sometimes Only Global, Sometimes Includes Public

I have a managed package that I distribute to clients and I'm running into a curious situation trying to help one install. I have noticed that in the Enable Apex Classes for their System Administrator ...
3
votes
1answer
26 views

how to divide string in the text field into two paragraphs? pls suggest any idea

I have a field, Description__C. when ever we enter a string (suppose if entered 140 characters string) in this field and save this, it should divide the string into each paragraph of 50 characters, ...
0
votes
0answers
23 views

Update fields after clone in apex batch class

I have below code where I need to clone a record but change some of it's values. When I try that, it simply seems to do no change on newly cloned record. Can someone let me know how to achieve it? My ...
0
votes
2answers
26 views

how can improve code coverage of this batch class..i m sending data of query still data is not sending in batch class

this is my main class global class BatchJobContractRetention implements Database.Batchable<sObject>,Schedulable{ public void execute(SchedulableContext sc) { ...
0
votes
1answer
28 views

Clone record with changes in few fields

I have below execute method of an apex batch class where I need to clone Question_Response_vod__c records of existing with changes in few fields. Can someone please guide me here. I have in code to ...
1
vote
1answer
26 views

map parent Id to all its child records ( getting Error: Incompatible value type )

I have below snippet of apex class where I face below error to compile. Can someone please help? Error Incompatible value type Survey_Question_vod__c for Map> Code Snippet List<...
2
votes
1answer
144 views

Clone record issue

I am facing a problem regarding Clone of record. I have an apex page as detail page of Survey__c object. There is a clone button to create new record from existing one via an apex class. Now I am not ...
0
votes
1answer
32 views

Unable to Delete Class Using Eclipse Force.com IDE

I have a few classes and matching test classes that Force.com says are deleted, but then counts those classes toward the test coverage minimum. I changed the status of the classes to "Deleted" in ...
-1
votes
1answer
37 views

Why am I getting the System.DmlException error when running my test class

I am running the test class below and it keeps on giving me the error.Would appreciate your help on this: Here the error message Error Message System.DmlException: Update failed. First exception ...
1
vote
1answer
62 views

System logging: How to get.SobJRecordType() Record Type Name

Related to my latest flurry of questions, I am trying to write the Record Type Name as a String data type into a text DML Log custom object field. You will likely be able to tell by my code that I ...
1
vote
1answer
18 views

Why is get.sobject('Id') method appending a 3-char string? [duplicate]

I am creating a custom DML Log in our Salesforce sandbox, and I created a Class & method that fires based on an Apex Trigger Here's the class: public class Util { public static void ...
0
votes
0answers
21 views

Test class for methods that query Data.com tables such as DatacloudContact

I was wondering if it is even possible to write a test class for a method that makes a call to a Data.com table such as DatacloudContact. When I run the following test class (below) it does not run ...
0
votes
1answer
30 views

How to check whether field is Updateable or not on Visual Force page itself

Here i am trying to check whether the case field is editable or not and if it is editable i want to show a text box there, is there any way to check it on Visual Force page itself. can anyone please ...
0
votes
1answer
32 views

Error: Compile Error: Loop must iterate over a collection type: String at line 53 column 26 [closed]

public class Admin { public String Name{set;get;} public Date Expiry{set;get;} public Decimal InStock{set;get;} public Date ManufacturingDate{set;get;} public PageReference inserthere() { ...
1
vote
1answer
16 views

Salesforce : Get ActivityDate associated with an object

I am writing a program to fetch the 'ActivityDate' associated with an object on a class. Below is the code that I used. But I am not sure, how to fetch it in a variable. List<Pt__c> partc= [...
0
votes
1answer
24 views

Build Dynamic Search page for Custom Object ''Building''

I am a solo admin with no dev skills. We have a requirement to create a searchable page for our custom object ''Building'' they would like this page to allow user to search for building records, ...
1
vote
1answer
45 views

I have no errors but my pagination is not working

I wrote a code which includes several functionalities and in which pagination also includes, my other functionalities are working good but the pagination is not working. Can anyone please look at it. ...
1
vote
1answer
35 views

Test Trigger code on Campaign Member

I have a relatively simple trigger that changes a date on the Contact record based on a change to the Status Value in the CampaignMember record. The trigger seems to work. Excuse all the .debugs, I ...
1
vote
1answer
36 views

JSON.deserialize for Date.class returning a wrong date

I am passing a serialized date through JavaScript using Remote Action. In Apex I deserialize this string to a Date but the date returned is not what I am expecting. Here's my code: Date ...
0
votes
1answer
37 views

Can you test an apex class using more than 1 Test class?

Can you test an apex class using more than 1 Test class where the combined testing of the 2 (for example) test classes means the target class is tested to more than 75%/
0
votes
0answers
26 views

How to delete selected profiles from the pageblocktable?

I am displaying the selected profiles on another pageblocktable but my requirement is I want to display the selected profiles on another pageblocktable and at the same time I want to remove those ...
1
vote
0answers
47 views

Feature works in sandbox but not in production

I've developed a button to send a custom email with a template in an Opportunity for a client. All went well in his sandbox environment, but when the feature hit production, Salesforce won't stop ...
0
votes
1answer
66 views

How to export data using reports from SFDC programmatically?

We have an issue where we have to manually click Export Report on SFDC reports though the UI on many reports. These reports have several filters and filter logic such as "(1 or 2) AND (4 AND 1)" and ...