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

2
votes
1answer
31 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 ...
-1
votes
0answers
15 views

Process request which creates and maintains Account Lists [on hold]

I hope you can help me to build an apex class and batch job to meet our clients need below. I am very new to apex coding, actual I'm just taking trailhead for beginner developer. • For each Account ...
0
votes
1answer
22 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
30 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
50 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
14 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
17 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
22 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
13 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
18 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
33 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
31 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
20 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
36 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
20 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
35 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
46 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
19 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
67 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
84 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
251 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
55 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
16 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
29 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
40 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
42 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
31 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
34 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
40 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
91 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
26 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 ...
0
votes
1answer
23 views

How to get Approval submitted Date and Time for the existing data

Have written this code for to get Approval submitted Date but getting an error Incompatible value type Datetime for Map<Id,Date> Please help me anyone here. Map<id,Opportunity> accounts ...
2
votes
1answer
41 views

Too Many SOQL Queries: 101 Error with 2nd Class

I have created a custom report for pulling quite a bit of data from Salesforce. I have a special circumstance that requires a VF component and a 2nd Class to get some data due to the way the Objects ...
0
votes
1answer
40 views

Batch Apex Failed First error: Only variable references are allowed in dynamic SOQL/SOSL

I posted a question yesterday check it here, the answer was to create a batch to run the code. i tried to write a batch class to solve the problem knowing that i have never done that before. But ...
0
votes
1answer
54 views

Trigger not triggering from test class

Not sure why the trigger isn't firing from the test class. Any suggestions are greatly appreciated My code validation is 0% for the trigger and it doesn't check the main class. I assume that is ...
0
votes
1answer
39 views

How to Set Valid Lookup?

I am in the process of validating a trigger that invokes a class that will perform calculations on a child object. I keep getting the error below. I know how to fix the error but when I add the ...
0
votes
2answers
24 views

Apex Class invoked by Trigger works fine for After Update, but not for After Insert

After many hours (possibly days!) I'm struggling to understand where the issue is with my code and your help would be much appreciated. I have a Trigger on the Quote Object, which calls a Apex Class. ...
4
votes
1answer
41 views

Can I Retrieve Deleted Content From An Apex Class?

I had an Apex Class of 900+ Lines Of Code two days ago. Now it only has 2 LOC. How can I retrieve the missing code? Is it possible to get it back?
1
vote
1answer
56 views

Apex Method Not Executing Inside Apex Class

I'm new to Apex and trying to make quick work of a problem I thought would be easy to solve. Essentially, on a button click from an account page, I'd like an Apex Class called that compares our ...
0
votes
1answer
27 views

test class for a controller

public class AccountNumber { public static string r; public list<Customer_Details__c> ds; public static void UpdatingAccountNumber(list<Customer_Details__c> ds) { ...
1
vote
1answer
50 views

UserInfo.getProfileId(); on test class

I'm writing a test class where I need to create an activity with the current user's userid. The test class passes, but no matter what I do Salesforce will not let me upload it. The problem is the ...
0
votes
2answers
95 views

Apex Test Class for Trigger on ContentVersion

I just finished writing the trigger below and I am so excited that it works. This is the first time I have ever done a trigger on the ContentDocumentLink object. I am now trying to create a test ...
2
votes
1answer
16 views

Batch being blocked by a trigger

I have a trigger that prevents update of a specific field. At the same time I have a batch that is supposed to update that field. How do I make the trigger allow the batch to run its job?
1
vote
1answer
55 views

Split by semicolon of a string not working

In below code semicolon separation not working for string with email addresses. Can someone help please? Apex code List<ABV_Form_Request_abv__c> Useremails= ...
1
vote
1answer
55 views

use trigger to match and populate field based off of another object

So as the title states I am trying to populate a field from the premium object with data from fetchRates. I have code that works but it is not populating for some reason. Any assistance would be much ...
1
vote
1answer
24 views

Code coverage stops for no apparent reason [closed]

I'm working in the developer council, and my code coverage stops at line 19 for no apparent reason (c.RecordType=rtO;). I would like to upload my code. It's a bit messy, but it's working perfectly ...
0
votes
1answer
28 views

Trigger after insert calling method in class [duplicate]

Added a trigger which in turn calls a method in class but is failing. My error is: Apex trigger MyTrigger caused an unexpected exception, contact your administrator: MyTrigger: execution of ...
-3
votes
1answer
43 views

Could anyone help in writing a test class for this batch class? [closed]

global class HIPIBatchJobContractRetentionDelete implements Database.Batchable<sObject> { global database.querylocator start(Database.BatchableContext BC) { String query = 'select ...