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

Test Class error while having an OrderItem into it

Hi I am trying to have an orderitem into my test class in order to test a trigger. class is : ` public static testmethod void TaskTrigger_Test1() { Account a = new Account(`enter ...
0
votes
1answer
16 views

Test Class Problem

I am having a hard time to run my test class for my trigger WHERE my trigger updates the Contacts Mailing to Accounts Biliing Address whenever the Accounts Billing Address is updated. This is my ...
1
vote
2answers
48 views

test class for a trigger

I have 2 triggers into sandbox that work s perfectly and I want to transfer it into production. The only problem is that I need to write a test class for each one in order to cover 75% of the triggers ...
0
votes
1answer
28 views

Showing an exception when saving apex class or trigger from laptop

I am trying to implement an apex class in my developer organization on my laptop but I'm not able to save the class. It gives me this message: Error: Compile Error: unexpected token: 'undefined' at ...
0
votes
0answers
29 views

How can i check null values in list [duplicate]

public PageReference saveObjective() { System.debug('checkValue'+checkValue); String parentName=QueryBuilderUtility.getRelatedObjName(objConfigurationQuery.sObject_4__c, ...
-1
votes
0answers
27 views

on save method check null at any of the field

Hi i want that if any of the fieldvalues gets null then i will display message. public PageReference saveObjective() { System.debug('checkValue'+checkValue); String parentName = ...
0
votes
0answers
28 views

Test Class - How to create a Partner Account

My need would be to create a Partner Account (that is: an Account with field isPartner set to true!) in test class, having checkbox PartnerAccount set to true, but I'm not having success with this ...
2
votes
1answer
45 views

Including more crtieria to if statement on Apex class

I need some help I have an apex class which needs amending so it works on more than one criteria. Currently the class works if “Type” Contains the word “Meeting”. But I also need it to include the ...
1
vote
2answers
39 views

Helper Class Error - Grouping in Aggregate

I don't get an error in the console, but for the below helper class but when I edit my record I get this error on save: "Error:Apex trigger RoomTypeTrigger caused an unexpected exception, contact ...
0
votes
1answer
31 views

Stop Apex Class From Failing

I have a class that is failing OnAfterInsertUpdate. I'm getting the following errors: First error: Apex CPU time limit exceeded and "First error: Update failed. First exception on row 1200 with id ...
0
votes
0answers
34 views

Need help with Apex Test Class

I have an Apex Trigger that fires after insert of a Task, so I'm trying to write a simple Test Class to create a Task to get my code coverage. My code is listed below: @isTest public class ...
0
votes
1answer
41 views

Get selected Parent row and Child select records from nested pageblockTable

I have a nested table, the third column displays the Child records related to the Parent Account. I am using a wrapper class to get the selected row but now i need to get the selected records from the ...
0
votes
0answers
41 views

Exclude weekend and holidays in salesforce formula field

I have a requirement to show the 1st Followup due date (which is 3 business days from the service Due date), 2nd Followup date (Which is 6 business days from the Service Due date) and 3rd Followup due ...
1
vote
1answer
24 views

Trying to Transform this Trigger to HelperClass

I wrote the trigger and it works great but now I need to transform it into a helperclass so I can reference it on our master trigger for the Case object! This is my first trigger to ever write and I ...
0
votes
2answers
32 views

Accessing PageReference method from different class

I'm a newbie to salesforce. I have 2 Apex class as follows: public class A { B bb; public PageReference save() { bb = new B(); return bb.pay(); } } public class B { public PageReference pay(){ ...
1
vote
2answers
46 views

confused regarding static variables

Till now my idea was static and new keyword are independent but when using testclasses I've found new concepts which are confusing See below class , We've to declare list as static to use it in ...
0
votes
1answer
32 views

Intialize inner class variable from a different class

I am bit confused on accessing the inner class variable from a different. I have created a class structure to serialize and create a json request. I need to send an custom object with attachment. ...
0
votes
1answer
7 views

Translate Spanish characters to english [duplicate]

I have a custom object Address. Here in Line 1 (text) there Spanish characters are enterred. How to achieve a translator by a custom setting or any other way for data in salesforce? Can someone please ...
1
vote
2answers
98 views

Collection is read-only - Apex Class Error

I am trying to move my trigger into a class, and then call the class from the trigger. However, I'm getting an error when I try to do an insert, update or delete on my VOActivity object. The error ...
0
votes
1answer
19 views

Translate spanish characters to english for field values

I have a requirement to translate few predetermined spanish characters to english in field values of different custom objects. I have tried to create a generic code. can someone please let me know ...
0
votes
2answers
42 views

Null Pointer exception

I have below generic class, whose methods are called from an Account before insert , before update trigger. Below class is getting a Null Pointer exception for any Account at commented line. Can ...
0
votes
0answers
22 views

Generic class to do trigger operations

I have a requirement to create a generic class having a method to do all operations as in my below trigger. Now this trigger will invoke the method of generic class to do the operations passing ...
0
votes
0answers
40 views

Help with Inserting an Opportunity in a TEST Class for Code Coverage

I'm having issues with an APEX test class to provide code coverage to a Trigger I created. Here is the code of the Trigger. trigger UpdateOpportunity on Opportunity (before insert, before update){ ...
1
vote
2answers
38 views

Class to auto-create a record once a day on a schedule

Is it possible to create a class that will automatically add a record every morning at 9:00am? The record will have the same data in the fields it just need to automatically insert every morning. ...
0
votes
3answers
34 views

Picklist Values Synchronizing across objects

Good afternoon I am hoping someone can help. I have spent the last couple of hour’s researching the different possibilities and I am none the wiser Aim – If a value is added to the following field ...
4
votes
3answers
179 views

Apex Test Execution Stuck in Queue

I have attempting to run an Apex Test Execution and my test has been stuck in "Queue" since yesterday. It doesn't look as though I , as the Admin, have been locked but still no progress on the queue. ...
1
vote
1answer
30 views

How to select one field from one table in apex class?

I have an apex class with some code like this: public List<Product2> myList{ get{ myList = [Select p.url__c, p.ProductCode, p.Nom_du_produit_2__c, p.Description From Product2 p ...
0
votes
1answer
30 views

Apex Class that checks a checkbox when contact is generated (match.random)

I have partly created an apex trigger that randomly selects a contact that is in a specific campaign. This works and I can cycle through the contacts at random. When i refresh the page however I am ...
0
votes
0answers
30 views

split method occuring once

I have below class snippet where split method is parsing data only once. It should be doing for all data. csvfilelines.size() shows 5 but records displayed from the sObjectList is only show one. ...
0
votes
0answers
15 views

Apex Test Class for a Lead Trigger [duplicate]

Hi I am new to the salesforce development. I have made a trigger by looking at some videos but not sure about how to make a test class for it.I am pasting it over here. how shall i start. I havenot ...
0
votes
0answers
25 views

Store record values before update

I have a requirement to allow User Rollback the Updates here by one click on a commandbutton. That feature I have tried to tackle by Revert Changes button here . Is there any other way to deal with ...
0
votes
1answer
73 views

Display error message from controller fails

I have below apex page where I am trying to catch a custom apexpages.addmessage from the controller. But it is not working , simply not displaying the error message in page. Can someone please help? ...
0
votes
0answers
17 views

Write a batch class which will delete the saved files from that folder

Can any one help me out this ? Write a batch class which will delete the saved files from that folder and e. Batch will run every week.
0
votes
1answer
92 views

Access user creating a record in before insert trigger

I'm trying to set some default values for contact fields based on which user is inserting the record into the database, but am coming up against a NullPointerException as the CreatedById is null ...
0
votes
1answer
31 views

Attempting to deploy SF samples to sandbox, blocked by low test coverage

I'm trying to deploy a class to production, and after doing some reading I set up the proper ant things and decided to deploy the sample classes to the sandbox first. I get the following errors: Code ...
1
vote
2answers
219 views

Compile Error: Constructor not defined: [MyController].<Constructor>(ApexPages.StandardController)

Can I get some help with my test class for my visualforce page? The page lists contacts and then the controller creates an activity for each contact selected after a button is clicked. I am ...
1
vote
1answer
21 views

Eclipse IDE changing class status to 'deleted' does not stick

I am trying to delete a class in production.I have deleted 2 classes successfully by changing the status of the corresponding metadata.xml to deleted.But in one class while I am trying to change the ...
0
votes
2answers
60 views

How can I move the following trigger logic into an apex class?

How can I move the following trigger logic into an apex class? trigger AssignAccNumber on Opportunity(before insert,before update){ List<Id> accIds = new List<Id>(); for(Opportunity ...
1
vote
1answer
74 views

System.DmlException: Insert failed. first error: REQUIRED_FIELD_MISSING, Required fields are missing: [AccountID__c]: [AccountID__c] line 49

I'm trying to CREATE or UPDATE an SOBJECT "AccountProjectEngament__c" this following code works on my sandbox, but i can't upload it to my production site. i have the following error: ...
1
vote
1answer
33 views

Initial term of field expression must be a concrete SObject: LIST<Call2_vod__c>

I am getting subject error with below code. The line number is on update statement conditional if clause. But I can't get why I am getting such error? I have a trigger validation for those ...
1
vote
3answers
102 views

Detail of Page A Repeating on VF Page w/ Custom Object A Sibling Object Records B on Visualforce Page

I have a custom object "Success__c" that I am attempting to create a visualforce page for. I would like to have the parent (MD relationship via account__c) Account fields on the page, as well as the ...
0
votes
1answer
25 views

Attempt to de-reference a null object: Error though have data

I am getting the subject error for below piece of code , exactly at below line. Though I have data in call object.Can someone please let me know the root cause and guide towards it's remedy? error ...
1
vote
1answer
52 views

Type casting error

I am getting runtime type casting error with below code. Can someone please help? Code: global class batchCallUpdate implements Database.Batchable<sObject> { global Database.QueryLocator ...
1
vote
0answers
26 views

Update fails without error

I have below class where update on mycallsInc not happening. Can someone please help me? public void Publish() { List<Incident_abv__c> selIncs = ...
0
votes
2answers
25 views

For loop issue in class

I have to get IDs of Call custom object from Incident Transaction custom object and run a for loop on call feeding the list. Can someone help me here? List<SObject> myCalls = [SELECT ...
2
votes
2answers
203 views

Can I override a private abstract method from abstract class?

I have an abstract class which has abstract methods. All methods are public. I don't need them to be public, so I tried to remove public or put private. But it keeps saying Compilation error: ...
0
votes
0answers
15 views

Track records update based on User entry

I have a requirement to show five sections with different SOQL querry records. Now one common field in all of them is an input text PICKLIST field. While doing update I want to track only those ...
0
votes
1answer
61 views

Update list values in an input text field

I have below code to update the input text field value for OUTCOME field from the User. My list update is failing to happen without throwing any exception. Please can someone help me here? My ...
3
votes
1answer
111 views

Can I save a new Apex class using Tooling API in java?

Is it possible to create a new Apex class using Tooling SOAP API in java? When I'm trying to do that I get ApiFault exceptionCode=’INVALID_TYPE’ exceptionMessage=’This type of object is not ...
0
votes
1answer
17 views

Need to refer child objects records also in PDF

I have a requirement to display child object records also alongwith Parent records. Please find the below SOQL pattern. SELECT Name, Account_Abs_abv__c,Account_Location_abv__c,Attendee_Role_abv__c ...