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
18 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 ...
9
votes
4answers
569 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 ...
1
vote
3answers
48 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
52 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
19 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
21 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
31 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
25 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++) { ...
1
vote
1answer
53 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
36 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
29 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
23 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
21 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 ...
-1
votes
0answers
20 views

how to split a comment into two in chatter?

I have a requirement on chatter object. While commenting a post, if the comment exceeds 10 characters, the remaining text should be displayed in another comment. Suppose, If I entered 'My name is ...
0
votes
2answers
25 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
21 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
21 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 ...
2
votes
1answer
134 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
26 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
35 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
59 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
16 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
20 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
24 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 ...
0
votes
1answer
29 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
15 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
23 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
37 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
33 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
25 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
22 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
44 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
52 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 ...
1
vote
1answer
21 views

create apex class test that have Data Type formula fields

My code coverage for my trigger is only at 50%. I have 2 (Today_10_Trigger__c,Record_Type_Hidden__c) fields in my trigger criteria that are formulas therefore not writtable. This is my Trigger: ...
3
votes
2answers
68 views

Why is System Assert returning wrong value (Trigger & Test Class)?

Context: I am trying to build a dupe counter that counts how many Leads match based on the Email value field. Here is the trigger: //Look for duplicate contacts based on email //Populate a ...
3
votes
2answers
87 views

Apex if statement to test if user has a company email address

After some serious help, I've achieved what I was hoping to achieve in my code. However, now I need to add one more piece. Essentially, I need to test if the User being added has an email address ...
4
votes
2answers
255 views

Custom Iterator not Working

public with sharing class CustomListIterator { list<integer>num = new list<integer>{1,2,3,4,5,6}; iterator numIterator = num.iterator(); ...
3
votes
1answer
69 views

List has no rows for assignment to SObject - Test Class

Another one of these, I know. I have been looking at similar errors for the last few hours with no luck. I tried using a "Try" "Catch" workaround with no luck, I tried using an Array, I tried making ...
0
votes
0answers
20 views

Schedule Apex class code coverage at 0%

I have been working on this yesterday. I am still new to developing APEX code so go easy on me. I just need someone to point out where I am going wrong. I am attempting to create a trigger (new task ...
1
vote
0answers
32 views

Help creating a test class for automating contact creation

I'm very new to Salesforce, Apex, and programming in general. I'm having trouble creating a test class for my class and trigger. I've looked through similar questions, but they all seem to be far ...
1
vote
2answers
42 views

How parameters works which we pass in class

public static void updateAdminContact(List<Accreditation__c> newApplicationList) { Set<ID> accSet = new Set<ID>(); for (Accreditation__c ad : newApplicationList) { ...
1
vote
0answers
25 views

Apex class assistance [closed]

We have a Trigger that calls out a Class everytime the Account Record Type is changed. I am new to this and we would like to make sure that the class will not delete anything or update anything but ...
3
votes
2answers
43 views

Submit button won't ReRender my VF Page

I am in the final stages of creating this awesome custom VF report. Everything is coming together but now the Output Panel won't refresh. I have it setup so an end user can select a date range and ...
2
votes
1answer
33 views

How To Change Apex Class into a Scheduable Apex Class

I am still a beginner and I trying to create a trigger that will create a task on a weekly basis (task once a week) until a field in the opportunity is label complete. This Trigger and Class work, as ...
0
votes
0answers
42 views

How to serialize JSON with apex wrapper class?

public class etTemplatePR { public String toAddress, templateId, contactId; public Integer requestId = 0; //public tAS[] templateAttributes; Map<String, String> jsonStr = new ...
0
votes
0answers
48 views

How to write test class for auto-generated JIT Class SSO

private void handleUser(boolean create, User u, Map<String, String> attributes,String federationIdentifier, boolean isStandard) I am just creating a user in SSO JIT using this handleuser ...
2
votes
2answers
92 views

Need to write a Wrapper Class

This is my first wrapper class and I think it is a hard one. I tried to put this all into one query and it failed because of a junction object. I then put it into 2 queries using components and it ...
1
vote
1answer
31 views

Need to Loop through SubQuery to pass info to other query

I have a very unique problem. I am trying to query a lot of data which passes through a junction object. The junction object makes it complex as I can't query around it. I need to pass the Ids from ...