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
9 views

Counting Activities (Open/Closed Tasks and Open/Closed Events) Compile Error: expecting a colon, found 'system.now'

Issue: Below is a part of my class for updating Activity Count fields. I want to only select the id's from closed Tasks and also closed Events. I have no clue why my two lists below give me the ...
6
votes
1answer
38 views

When to add apex class permissions to a profile

The apex class permissions are a bit confusing to me. For example, classes used by page controllers do not need to be added to the profile. Can anyone give a complete list of scenarios on when you ...
0
votes
2answers
21 views

Apex Test Class for trigger [on hold]

Below is my first trigger and it works! Then I found out I had to right a test class and I have no idea where to start. Please advise. Thanks! trigger CreateProject on Opportunity (after update) { ...
3
votes
1answer
43 views

Creating a Custom Object Handler Class

So I want to create handler classes for different Objects with my SF org, specifically for some of the custom objects. For instance I have a Global__c object that stores global settings in encrypted ...
3
votes
1answer
31 views

How to achieve Test Coverage for Interface Classes

I am using the trigger framework presented here, which uses several interfaces and utility classes: ...
2
votes
1answer
24 views

How to create object by it's name?

I'm writing a REST service which calls external service. I want to write a test for my service. I came up with no possibility to mock this call as it's in managed package. I want to wrap this call ...
0
votes
0answers
19 views

Removing a selected case from the queue

I have a queue that cases are put into before notes are submitted to them. Right now I have two methods that remove the last entry and removes all entries; however, I cannot figure out how to remove ...
3
votes
1answer
47 views

Two almost indentical test class, one passed one failed

Someone else created a class and test class that works fine: CRequestForm_SearchController and CRequestForm_SearchController_test. I made some edits to the class in sandbox, and copied the test ...
2
votes
1answer
57 views

HttpResponse StatusCode=200, but 3rd party request (Pardot) not made

ObJective: I am attempting to create a new prospect in Pardot when a lead that had no email gets updated with an email (Pardot will sync accounts but until the lead email exist there is no prospect to ...
0
votes
2answers
29 views

How can I mock a query of ApexClass for testing?

While recently working on a large project where unit test executions would run upwards of 2 hours, we realized we could get a performance gain by avoiding touching the database (e.g. SOQL and DML) ...
2
votes
1answer
33 views

Attempt to de-reference a null object

When I try to load the visualforce page it gives me the error "Attempt to de-reference a null object " I have narrowed it down to the line of code lstNotes.add(new NoteWrapper(lstNotes.size(),new ...
0
votes
0answers
19 views

Share Map between Outer and inner class [duplicate]

I want to implement the following setup: public class Outer{ public Map<string,string> PackageTransportUnitType { get; set; } public Outer(){ PackageTransportUnitType=new ...
2
votes
1answer
29 views

Not enough coverage for Apex utility Class, although COLLECTIVELY my unit tests cover everything

I've moved a lot of my trigger code over into class methods so I can control what order the logic happens in. Each object has one Trigger like this, and each Trigger may might call up to a dozen ...
0
votes
1answer
25 views

Accessing Picklist values from controller

I am trying to bind a pick list from a controller, my goal is to get the IDs from User Object and display them in the pick list. Any help will be appreciate it! VF <apex:selectList ...
1
vote
2answers
62 views

TEST Class for a SalesForce Trigger error

I'm trying to get code coverage for my trigger for when I deploy my trigger to production. This is my first time trying to provide code coverage to a Trigger in SalesForce, as I'm new to creating ...
0
votes
2answers
37 views

Help with writing test class

I am having trouble writing a test class for this trigger: trigger backToIdea on Idea_Lobby__c (after update) { for (Idea_Lobby__c yourIdea : Trigger.new) { if (yourIdea.Approval__c == 'Approved') ...
1
vote
1answer
52 views

Display list of inner class objects from VF controller

I have the following class, that implements 2 custom inner classes, with a list of one type inside another class. What this does is do a callout to an external REST service, gets back a JSON response ...
3
votes
0answers
34 views

Send PDF from Salesforce to EchoSign through Apex REST and EchoSign REST API?

How to send PDF generated from VF page to EchoSign through Apex Code and REST API of EchoSign? I'm getting error as "Content Type not Supported/ UNSUPPORTED_MEDIA_TYPE". Any idea? String ...
0
votes
2answers
44 views

I need help writing a test class

I have written the below trigger and helper class. I am a newbie and pieced the trigger and class together with help from various forms. It works fine in sandbox but I have no idea how to write the ...
-1
votes
2answers
85 views

Too Many SOQL Queries 101 though limit 100 [duplicate]

I am getting this error though limit 100 is provided in SOQL statement.Can someone please suggest a way out here? Apex code: public class Attachments_11{ public List<attachmentCaseWrapper> ...
0
votes
1answer
52 views

Error “Initial term of field expression must be a concrete SObject: LIST” when fetching values from list

Can someone please help me here?I have the piece of code here alongwith the error I am facing. Apex class:Code snippet: Map<Id,Attachment> mapCaseAttachments = new Map<Id,attachment>(); ...
1
vote
2answers
140 views

Pagination in apex

I am getting an error of limit exception in salesforce for SOQL results more than 1000. I need to show 50000 records in a pdf page(may be in different pages). Can someone help me here to do ...
1
vote
2answers
33 views

How to insert list records from one object plus form inputtext box data to a different object?

I have a VF page that List account records that meet certain criteria. The user would select which accounts as well as fill out a couple notes fields (that do not exist in the Account object). Once ...
2
votes
2answers
305 views

Compile Error: Method does not exist or incorrect signature: Test.startTest()

I am experiencing something weird on the Sandbox with all the test classes. whenever I run a test class I get the error: Method does not exist or incorrect signature: Test.startTest(). I am ...
0
votes
0answers
53 views

System.QueryException: Record Currently Unavailable:

I am having issues with one DML operation. This control is for an API that runs all day long, so jquery checks for the size of the list and when is equals to 0 it starts over again. So the page do not ...
0
votes
1answer
45 views

Apex Batch: Query locator failure

I am facing an issue with the querylocator line here. My code snippet as below. global Database.QueryLocator start(Database.BatchableContext BC){ query = 'select Id,(select Name from ...
1
vote
1answer
46 views

SOQL Parent child relating issue

I have to pass a child record's field value while iterating by Parent records. I am getting invalid Foreign key relationship error. Can someone please help me here? Code snippet: global class ...
0
votes
1answer
47 views

Query result optimization

I have a custom object Call2_vod__c which is detail of Account. There might be 100 calls for one Account. I need any one call record with that Account. How should I do the query? Please find my piece ...
1
vote
1answer
28 views

return class objects but in generic manner

i want to return class objects but in generic manner. Comsider lot of if conditions and in each i am creating an object of one class; but want to return at last using only one return statement. How ...
2
votes
1answer
61 views

Apex properties in helper class

I have an apex helper class named "PricingConversion" called from my apex controller "DeaRowEdit". PricingConversionHelper.CalculationSecondPricingTon(dealrow); I would like to move the properties ...
0
votes
2answers
104 views

Heap Storage Limit exception while creating attachment

I have a custom object Call2_vod__c which is detail to Account. It has a Signature_vod__c field that is in encoded base64 format. Now for one Account, I can create an attachment from any of the ...
0
votes
2answers
32 views

field value contained in list

I have an apex class where I need to check if a field value of a particular record is contained in a pre-defined list. Please find my code here.Can someone please help? Apex class: global class ...
1
vote
3answers
59 views

How to auto-refresh page after Visualforce Error

is there any way to refresh page after an Visualforce error: like 'Unable to lock row' please I need help, i was trying to use window.onerror to reload the page but that doesn't work. so I was curious ...
0
votes
0answers
21 views

UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

The code below is for an API that runs all day long. sometimes I get this error:UNABLE_TO_LOCK_ROW I made some research about this issue and I am using FOR UPDATE in the query but is still happening. ...
0
votes
1answer
166 views

Too many DML rows: 10001(bulk update)

when I try to run the code below I am getting this error: 'Too many DML rows: 10001'. The object that I am trying to update is one of the main object in the org. so it has multiples triggers, ...
2
votes
1answer
75 views

Dynamic SOQL for Cross-Objects

I am wondering if there is an easy way to dynamically query accounts based on the account having the primary FSE name attached to it. The Primary_FSE__c field is on the Installed Product Object, which ...
1
vote
0answers
27 views

Export Test Execution result to excel through developer console/ SFDC org

I just did a Run all test. I want to export the results (all failures and successes) into an excel sheet. is it possible? Thanks.
6
votes
2answers
221 views

First trigger: coding - best practices

This is my first production trigger and I'm just wondering if there is a more efficient way to write this code. Basically, if a campaign meets the criteria in the IF statement, I want it to create a ...
3
votes
1answer
39 views

problem with sObject as parameter

I get the below error when I try saving CLASS 1 below. The second class that is the problem is also below. I obviously don't understand objects or apex well, so any help would be greatly appreciated. ...
7
votes
3answers
295 views

How to delete a Test Class WITHOUT using eclipse

I cannot install Eclipse, even if I wanted to. It is not approved software for my org. How can test classes be deleted from production, using deployments? There no 'active' checkbox when I am ...
1
vote
2answers
79 views

How to create a hyperlink within a FeedItem using Apex

how can i bring out something similar to " < a href="Https://www.google.com">Search " in the following code. trigger chatterfeed on Feedback__c (after update) { for(Feedback__c ...
1
vote
1answer
92 views

Having issues deploying code 'Too many SOQL queries: 101 '

Hell community, I am trying to push a class and I am getting this error: Too many SOQL queries: 101 for test class(ClonePlus_Test) below is the class ClonePlus_Controller. Can anybody please tell ...
2
votes
2answers
54 views

Class Properties are not accessible

I am new to Salesforce and have what I though would be very simple code. For some reason this is throwing an error: public class GetSet { public class BasicProperty { public integer prop ...
3
votes
1answer
151 views

List has more than 1 row for assignment to SObject

Can anybody help me with this script, this is a simple update when the trigger is fired, (it works in sandbox) What can I use instead of items.values().PO_Details_Ordered__c = ... I am pretty sure ...
2
votes
1answer
61 views

Test Class is not working for Map in class

I am not able to get coverage for the Maps in the class. I only getting 54% coverage and don't know what else to try. Can anyone please help me here. I will truly appreciate it! public with sharing ...
1
vote
1answer
15 views

Can we generate a WSDL from an Apex class

Is it possible to generate WSDL from an Apex class ?? Cause i want to check one request but i don't have the WSDl to check from SOAP UI.
0
votes
1answer
165 views

Error: 'System.LimitException: Too many SOQL queries: 101' [duplicate]

I am getting an error: 'System.LimitException: Too many SOQL queries: 101' when I run a testing class for another class similar to this one, which is located in the same Object. I am trying to use ...
1
vote
0answers
28 views

Compile error for datatype mismatch

Friends, I am getting below error on this line: if(dt.start_date_oapi__c.month()== todaydate.month() && dt.Year_OAPI__c == todaydate.year()){ dt.RecordTypeId = ...
1
vote
1answer
30 views

VF Controller search logic

The following is my controller for my VF page that is going to search for certain Super Customers. On every Account there is a field called Super_Customer1__c, and since Super_Customer1__c will often ...
1
vote
3answers
95 views

How to display an SOQL query in apex Datatable

I'm having a difficult time finding what (I think) should be a relatively simple procedure. I would like to create a class controller that returns a SOQL query and then display the results in an apex ...