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
votes
2answers
64 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
32 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
100 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
21 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
184 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
31 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
30 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
41 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
28 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 of ...
1
vote
1answer
27 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
37 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
74 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
27 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
41 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
19 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
54 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
56 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
24 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
196 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
37 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
274 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
55 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
75 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
52 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
77 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
37 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
13 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
76 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
26 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
25 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
65 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 ...
1
vote
3answers
120 views

Method does not exist or incorrect signature: [String].getDescribe()

I've checked the other answers and googled alot, cant seem to find the answer to why this doesnt work: public List<SelectOption> AccountIndustryOptions = new List<SelectOption>(); public ...
1
vote
2answers
63 views

UML Class Diagram Force.com Project

Could you suggest me a way to generate a UML class diagram for a Force.com Project?
0
votes
1answer
69 views

Visualforce Page refresh lags current value of search filter

I'm relatively new to Salesforce development and am having trouble with a Visualforce/Apex Class page. The page pretty much works, except that I have a filter which should sort data by date. However, ...
1
vote
0answers
93 views

Search and Edit Records of custom object with Visualforce

i have a vf page and a custom controller . i have fields on page to create a new record in object but i also want to search a particular record in object and want to edit or update its feilds...... ...
1
vote
2answers
241 views

How do you test a class that only pulls data

I'm confused by this. When I was using a dev account it allowed me to create classes in Apex Class like this and deploy it with no problem, but now that I'm using our real account it won't let me ...
0
votes
1answer
27 views

test class Error need yours help [duplicate]

System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record, how to rectify kindly hep me
0
votes
2answers
61 views

I can't execute a simple batch class in my controller

I was about to use a batch class and now I'm stuck cause It wont execute. I don't know why. Here's the code from my controller class: public ConstructorName(){ dispForecastSummary(); } public ...
2
votes
2answers
44 views

Optimize SOQL response time when Where clause references a formula field

I am creating a dashboard, and for example a Formula field will identify if the record has issues. I know that Formula fields are not indexed in SOQL. Can anybody tell what's the best approach in this ...
6
votes
2answers
53 views

Getting the right converted currency in SOQL

What is the right way to get the converted currency in SOQL? I've got this in my query: SELECT Owner.UserRole.Name, Id, Name, Include_in_Forecast__c, convertCurrency(Amount) FROM Opportunity ...
3
votes
1answer
48 views

What is the correct way to check if two dates overlap

I have 2 object. They both have a start date and an end date. How can I check if they overlap? now I have: if((item1.DateStart__c >= item2.DateStart__c && item1.DateStart__c <= ...
2
votes
1answer
37 views

Sync Quote Automatically on record creation

I am trying to get our quote system to automatically sync a quote on creation if it meets certain criteria. (Status, and a couple of custom fields.) I have done some research and found a few places ...
2
votes
1answer
59 views

Apex Test execution Queued

I am trying to run my apex test classes but it has been in queued status for very long time ( 3 hours). Initially I attempted to all test classes - after the while I aborted as it doesnt provided the ...
6
votes
2answers
138 views

Set Contains method is not working correctly after overriding equals() and hashcode() methods

I have created one class name like Test and have overriden its equals() and hashcode() methods and then created its 2 objects like below - Test obj1 = new Test (); Test obj2 = new Test (); and now ...
1
vote
2answers
57 views

De-Reference Null Object

I am reusing some old code here - i've made slight changes but the code itslef is so old it contained the test class within the main class. I have seperated them out but I am getting a pile of errors ...
1
vote
1answer
29 views

Help comparing CreatedDate with a specific Date

can anybody help me with this query, i am trying to get records from 1/1/2014 i don't know how to do the right comparison. I will appreciate any help. Date d = date.newInstance(2014, 1, 1); ...
3
votes
2answers
70 views

Trigger to update sibling records after inserting a new child

How do I update children of the same parent after insert of a new child? For example, if I insert a new Contact with role of 'CEO' for an Account, then any Contact related to the Account with the ...
0
votes
1answer
18 views

After creating managed released package can we create new class or visualforce page?

I have managed released package and i want to create new class and visualforce page in same managed released package. Is it possible?
1
vote
1answer
56 views

Calling an APEX method from a different class

I have a method in one class, but I need to move it out to another class. I'm aware this question has been asked several times already, but I'm getting an error I don't understand. How can I call a ...
1
vote
3answers
46 views

deactivating classes in sandbox

fairly new and have been working out of my sandbox. i have created a couple triggers and i want to deploy to production. problem is my code coverage is only 17%. I have a bunch of testclass in my ...