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

0
votes
0answers
28 views

my first test class [on hold]

Please correct my test class for the following trigger. Bear with my mistakes plz trigger RecordOwnerChange on user (after update){ if (trigger.isafter & trigger.isupdate){ List<Id> ...
0
votes
1answer
22 views

Variable does not exist

This is confusing me and no matter how many times I read through it I can't seem to figure it out. I'm getting a Variable does not exist: listOfDels error on the last line of code. Can anyone see ...
1
vote
2answers
30 views

Aggregate SOQL cannot get average

So I've read the following: Can I assign Aggregate SOQL Result directly to variable? Using AggregateResult in Salesforce.com SOQL Soql avg,sum,max error in apex program Working with SOQL Aggregate ...
0
votes
1answer
9 views

Initial term of field expression must be a concrete SObject: List<Account>

Even it is pretty easy one, but error is not able to solve by me. public class one{ public List<Account> accs{set;get;} public void main(){ accs = [select id,name,type from ...
0
votes
1answer
26 views

How to use && in for loop of triggers

Following my previous question, I have 2 fields : 1.) Location 2.) Dest_Location I followed this link to make the apex class and trigger. But, when I put two triggers to get me geo location, it ...
0
votes
2answers
48 views

NullException in Apex Class

My below code is getting a NullPointerException: LINE 38 Account_List_vod__c acctListRec = nameToAcctListMap.get(affRec.To_Account_Value__c); I am unsure why I am getting this NullException. ...
0
votes
0answers
21 views

Error in running Insert Account List Item class

I am really new in apex class. I hope you can help me, I created a batch job to create/insert Account List records. Link to my batch job question: Help in converting my apex class to batch job This ...
0
votes
2answers
36 views

Help in converting my apex class to batch job

I hope someone can help to convert my class to batch job. This is the first time that I will create a batch job and only a newbie in apex coding. Here is my class which is working but hitting the DML ...
-4
votes
0answers
19 views

How to write Test class for the below batch class? [closed]

global class Batch_sales_load implements Iterator<AggregateResult> { AggregateResult [] results {get;set;} // tracks which result item is returned Integer index {get; set;} ...
0
votes
1answer
12 views

Invalid Type ExternalServiceUtils

I am completely new to salesforce . I have installed SoapBox to interact with the SQL server from salesforce. I have installed its API in the sales force environment as shown below figure. This ...
1
vote
0answers
41 views

Too many SOQL queries error on apex class

I have the class below getting data from a trigger (that seems to be working ok), the problem is, I am getting a "Too many SOQL queries" errors when it executes. If I comment out "insert ...
0
votes
1answer
12 views

Apex: conditional get/set

If I have a class that starts like this: public class BrowseController { String name = 'something'; } How can I write it so it changes based on a boolean's value? public class BrowseController ...
0
votes
1answer
17 views

Need help making changes to my RollUp Summary Trigger

I have created a Rollup Summary Trigger that will display a count of Assignments__c on the parent Contact page layout. The process for this has changed and now I need this field to display a sum of ...
1
vote
1answer
28 views

Is there any way to make a change to a managed package component outside of packages and patches? Or on the fly?

I received the following feedback from an SF customer service agent, and I am not sure I understood him 100% correctly. You are able to edit the code in a managed package in developer, trial, and ...
0
votes
1answer
28 views

how to assign data from Inner class to out class

i have succesfully parse my JSON data. but now i want data back from following APEX method "getCustomerData()" like below: DxModel[id=2, email=asd@GMAIL.COM, first_name=clerk, last_name=dx, ...
1
vote
1answer
26 views

Inactive Trigger Test Code Question for potential solution

I was reading this: Are inactive triggers counted against test coverage? And I had an idea pop into my head: Can I cover several apex triggers, using a single test function, if they all contain the ...
0
votes
2answers
28 views

Need to increase code covergae [closed]

I have 61% coverage i need to increase saveAccount() method. public with sharing class AccountCustomLookupCntrl { public Account account {get;set;} // new account to create public List<...
0
votes
1answer
34 views

Determine if Record is New Record

I am trying to insert a condition to check if a record is a new record vs. an existing record in a trigger, but I'm not sure how to incorporate it in my condition? I'm sure it's fairly simple, I'm ...
0
votes
0answers
20 views

Metadata API: Updating a picklist value to make it visible for selection on record types

Was able to implement the Metadata API using @future to make asynchronous callout via an Account Trigger to add picklist values to a custom picklist field on the account. However, it is added to the "...
0
votes
0answers
42 views

Insert class not working

I created a class to insert Account List record. The condition is allow duplicate Account List name, but the owner is different from the existing record. Example: Exisiting record: Account List ...
1
vote
2answers
48 views

convert hex value to integer

I am working on a method defined in a class that controls the lead object. The desired end result is to produce a unique number for each Lead record. I currently have this working, but the out put is ...
-1
votes
1answer
50 views

Insert logic to avoid record with duplicate name and owner, but allows duplicate name with different record owner [closed]

Can somebody help me with the logic on the following: Account List name is existing, but the ownerid is not existing (Different user) -> insert ok Account List name is not existing, but owner id is ...
0
votes
2answers
53 views

Class test for Trigger to match a field in object A with object b and populate a relationship lookup in b

I need some help to create a test class to validate the trigger down, someone help me? I do not know where to start, I've tried to get some example and build the class but I could not, yet Trigger ...
0
votes
1answer
23 views

Getting an error “Attempt to de-reference a null object”

I have a custom button which I am trying to work with. But i keep on getting error " Attempt to de-reference a null object Error is in expression '{!updateDb}' in component in page ...
1
vote
1answer
65 views

Delete class not working

I created an apex class to delete Account List record which has no Account List Items when I execute the class, it's not deleting the Account List with no Account List Item records. Objects involved. ...
3
votes
1answer
60 views

find out dependent fields, object and classes in salesforce

I want to know class is dependent to which class, object, and Field. I have tried to retrieve data from SymbolTable but it doesn't show me dependent Class Name or ID. Is there any another way to ...
1
vote
1answer
23 views

Page message show in apex page

I have a VF Page where Add button helps to add rows. If an input field value of first row matches with input field of the next or any later row's field value, system will show page message only on the ...
0
votes
1answer
16 views

Test Class for SchedulableClass

How can I write a test class for this scheduler class: global class AccountRevenueSchedulable implements Schedulable { private static final String EVERY_JAN_1 = '0 0 5 1 1 ?'; //every Jan 1 at 5:...
4
votes
1answer
157 views

Possible to declare static constants in an inner class?

I want to define an outer class with two inner classes, the inner classes containing specific constants related to each of them. For example: public class Stuff{ public class Letters{ ...
1
vote
1answer
66 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 ...
12
votes
4answers
681 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 ...
2
votes
3answers
83 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
72 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
30 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
27 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
33 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
49 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++) { answerchoices.put(sq....
1
vote
1answer
57 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
39 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
31 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
27 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
25 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 ...
0
votes
2answers
30 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
38 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
40 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 List<...
2
votes
1answer
146 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
35 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
37 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
63 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 ...