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
0answers
20 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
22 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
31 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
38 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 ...
0
votes
1answer
26 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
34 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
39 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
234 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
24 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
40 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
38 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
36 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 ...
2
votes
1answer
25 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
28 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 ...
1
vote
1answer
32 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
117 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
38 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
25 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
1answer
45 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
16 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
35 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
36 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 ...
-2
votes
1answer
59 views

Test class passed, but main class only 44%

Good Morning Salesforce Stackexchange I have the following test class called “DeactivateUsers_Test” which has passed however main class “DeactivateUsers” is only getting code coverage of 44% ...
1
vote
2answers
47 views

Pass value to a class from trigger and assign value to Object fields

I am passing the user.info to a class from a trigger, I am able to get the correct data from the query but I am not able to insert or update the object(User) fields with the data stored in a List ...
1
vote
1answer
52 views

Assign values from List to Object fields

I need to assign values from a List to Object fields (User). I am getting an error "Loop variable must be of type String". I will appreciate any help! Class code: public class ...
6
votes
1answer
292 views

Too many query rows 50001

Can anyone please tell me if there is something wrong with the scrip below. I am using LIMIT 50000 but still getting this error. I will appreciate any help! code: //for mws chart ...
3
votes
0answers
49 views

Override PartnerAPI ClassLoader

We have exported as Runnable JAR (Extract required libriries into generated JAR option) our proyect (which has dependecies the fuelsdk and axis). So, there are some classes which read properties ...
6
votes
1answer
105 views

Creating a class by consuming a WSDL document Schema:attribute

I have a problem with salesforce functionality. I've created flat WSDL file but when I am trying to create class in salesforce I still get this error: Error: Failed to parse wsdl: Unsupported ...
4
votes
1answer
87 views

Custom Button not firing apex class

I need some help. I have created the following button , however when i click on the button i get the following . This is the class, which i want the button to call. Anyone have any ideas why this ...
2
votes
1answer
78 views

What can I use instead of apex:repeat?

I need to find the way to use something different than apex:repeat. to assign the value="{!thousandBlocks} var="block" This is creating multiple tables and i don't want that. Let me explain you, ...
2
votes
0answers
74 views

Response size exceeded 15MB organization limit

I created this class that is requesting large amount of data, I was getting this error:Collection size 1,156 exceeds maximum size of 1,000. And then I found an approach to fix this error, the code is ...
0
votes
2answers
57 views

Retrieve Data from Custom Object in Datatable for a specific Account Id

I am trying to reference a custom object that has a related list on our account page called "SVMXC__Service_Contract__c" and has a child relationship name to accounts of: R00N70000001hzYIEAY. I need ...
1
vote
0answers
44 views

0% code coverage on apex class [closed]

Hope all is well I have the following class (see below), however i am unable to test my logic, as i am getting 0% code coverage.Can any one help me write a test class for the following class below. ...
0
votes
1answer
107 views

How to write a test class that has multiple IF Statements

I created this aggregateResult[] that returns the data I want, as you can see below i store the values in a List, everything works as I want but now I am completely stuck in the test class. I have to ...
23
votes
5answers
432 views

What are all of the reasons why Salesforce customers should upgrade the API version on their Apex classes, triggers, and pages?

I haven't been able to find any official documentation or community discussion of the compelling reasons to upgrade the API version on Apex classes, triggers, and pages. I know there is the general ...
0
votes
2answers
65 views

Test Coverage only 56%

I have the following test class that is only getting 56% coverage on my trigger. The trigger assigns numbers to the Account object. Any suggestions on improving my test coverage? trigger ...
0
votes
0answers
33 views

Create jQuey Chart based on the last 12 months rollup

I am modifying a BootStrap chart, my goal is to display the SUM(QuantityOrdered__c) for the month and the chart should display the months of the CURRENT_YEAR()=2014 The code below returns the month ...
4
votes
2answers
59 views

Is it possible to compare DateTime and Date in SOQL

I was wondering if it is possible to compare a DateTime and Date in SOQL. I am trying to pull data for the product that where sold today Date.Today(). Any ideas? I will appreciate any help ...
0
votes
1answer
65 views

Get a value just edited from controller to Visualforce page

I'm building a Visualforce page that let's the user upload some images, they can add as many images as they want, when they click on the "add new" button, a new record is inserted and one of the ...
1
vote
0answers
72 views

Assistance with a Test Class to increase code coverage

This is a follow up to my previous question of Is there anyway to deactivate a trigger in Prod when the minumum code coverage is not met. I am not an apex developer and I am the only SFDC Admin at my ...
0
votes
0answers
54 views

Help updating object record from VF page

i created a PageBlockTable, there is a button that open a popup window, inside the window I successfully display details from the child object. In this popup there is a button 'Save and close' for ...
2
votes
1answer
49 views

Testing class for variables inside a 'for' loop

I need help writing the testing class for the code below. I am getting 68% test coverage. all the code inside the for loop is not getting any coverage. I will appreciate any help. This is what I have ...
2
votes
2answers
231 views

How to use “Does Not Start With” in Where clause for SOQL

I need to hide a few accounts that start with certain numbers in the CustomerMasterID__c field on the account. For example, I need to hide accounts that start with 4504 in their CustomerMasterID ...
0
votes
1answer
70 views

get parent object record sorted by child object field

I have created one vf page on which I am showing records from parent object along with one date field on child object. For eg. Job(parent) and its taks(child), I am showing job details with one of ...
-1
votes
2answers
166 views

can't refer my pagereference methods from my testclass

--------------------------------------------class------------------------------------------- Public class OppExtension { private final Opportunity opt; public list<BucketRate__c> ...
3
votes
1answer
62 views

Upsert is creating duplicate child records

the 'upsert' is creating duplicates NRProducts. how can I make just an update? if the NRProduct is already there. let me explain you, there two objects parent(purchase order, po) and chld(purchase ...
-1
votes
1answer
80 views

Problem using [].substring()

I am having some issues using [].substring(). I am limited by using it. I would like to use a different approach because the qty can vary on length and this is not working for this solution. I will ...
2
votes
1answer
166 views

Get multiple values from VF Page and pass them to the class

the code below generates a table and each row has a check box, Name and I added an inputField and I would like to pass the value entered in the inputField, without storing the value in the object. ...
2
votes
0answers
38 views

Apex batch does not update scope

I just created a batch that set some null values in some fields, what I notice is that the batch sets the nulls but it does not update the Object. I need to Edit and Save in order to see the new ...
6
votes
1answer
68 views

How to search through global methods of managed packages?

You can see global methods in the managed package classes via Web UI. I have hundreds of managed package API classes that I need to search through by a keyword, to find a method that does what I need ...