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
0answers
14 views

How to bypass functional methods in an apex class? [on hold]

PAD.CanTrigger() is implemented but the method can be bypassed is "CaseTriggerHandler.onAfterInsert()". The idea is to be able to bypass "functional" methods and not only one method per trigger. ...
0
votes
1answer
36 views

Upsert only updates but does not insert a new record

In the below code i made some changes between lines 430 and 463 basically to update an existing record and insert only new records. I have used an upsert in line 463 but now its updating existing ...
0
votes
1answer
40 views

Roll up Summary via trigger for lookup relationship

I am trying to get this trigger to work but it is giving me an error and I am not able to figure out why. The error I am getting is "attempt to de-reference a null object) Why trigger? We have a ...
1
vote
1answer
71 views

LAST_N_DAYS doesn't work correctly

I have selected all accounts with a few information and the lastmodifieddate of the opportunities. I ordered the join by the lastmodifieddate DESC LIMIT 1. This is fine so far, when I output the date ...
0
votes
0answers
10 views

Parse XML data shown on Page in a list

I have below page and it's corresponding class that shows xml data on the vf page. VF Page: <apex:page standardcontroller="Marketing_Information_HS__c" extensions="DependantPicklistCon" ...
0
votes
2answers
37 views

Error: Compile Error: Illegal assignment from String to Boolean

as I writing a test class, I come across this error as I am attempting to save my file. Error: Compile Error: Illegal assignment from String to Boolean at line 15 column 13 Are there any ...
-2
votes
2answers
19 views

REGEX work for initial space with string

I have a requirement to find a string('Mc') which either present at begining of the field value or after a space. Can someone help as my code fails for 'hemchand'. REGEX Code: ...
0
votes
1answer
32 views

Modify batch class already in schedule

How can I modify a batch class that is already placed in a schedule. I have deleted the Scheduled job and still getting error to modify the corresponding batch class. Can someone please help me here? ...
0
votes
1answer
14 views

Unable to Save email in the Activity History

I have a custom button to send an email. The code is working fine. Now I would like to insert those email in the activity history. I did set mail.setSaveAsActivity(true). But when I click the ...
0
votes
2answers
20 views

Error: Compile Error: Initial term of field expression must be a concrete SObject

I am finding it difficult to resolve the error. Any insights would be helpful. It is showing error for this line String[] bccEmail = new String[]{opp.owner.email}; in the below code. global class ...
0
votes
1answer
26 views

APEX callout: job says complete however no update on our server with no debug log

I was testing out a new APEX callout where whenever an opportunity was won, it would call out to our application. I was able to get the job to complete, however I am not seeing the update take ...
0
votes
1answer
28 views

Salesforce Opportunity Revenue Aggregation- Apex Class

I have written the following class below to calculate the Revenue per Month given a Start and End Date and A production Revenue. However, I don't think this is the most efficient way. In fact I think ...
0
votes
3answers
40 views

Test Class doesn't push values into a trigger; Getting: System.NullPointerException: Attempt to de-reference a null object

I have trigger that on deployment is throwing a NullPointerException. The error is: Trigger.tgr_send_enrollment: line 13, column 1: [] System.DmlException: Insert failed. First exception ...
0
votes
0answers
50 views

Not executing part of class as user

I have been battling this for a while and I assume this might be a permission issue. I do have a trigger that updates sample requests for a product with manager that needs it to be assigned. The ...
0
votes
1answer
31 views

Is there a way to override the custom validation rules?

Is there any way to override custom validation rules? I have created a validation rule that does not allows to change on my custom fields but I want to make an exception to that it should allows you ...
0
votes
1answer
18 views

Updating the Custom Object - Attempt to de-reference a null object

I got stuck and now sure what I'm doing wrong here: here is my trigger: trigger EmployeeTrigger on Employee__c (after insert, before update) { EmployeeController mr = new EmployeeController(); ...
0
votes
0answers
19 views

Task Trigger To Populate Picklist if the subject line contains Email

I need some help. Aim – A trigger on the task object that populates the value “Email” In the field “Type” When the “Subject” field contains Email I have created the following trigger trigger ...
0
votes
2answers
40 views

Need to cover code coverage

Hi Below are my class and testclass. please check and help me out. class: public class IntegrationExecution{ public Boolean IsOrgName {set; get;} public IntegrationExecution(String ...
3
votes
2answers
98 views

UserInsertUpdate: System.LimitException: Too many future calls: 51

I have a trigger on User that after it's inserted or updated, I want a contact for that user to be created. For example, if a new user Fred is created, I also want a contact created with Fred's ...
1
vote
1answer
24 views

Finding the current RecordType name selected by user

Updated code to give you more context of what I'm doing. trigger vendorTrigger on vendor__c (after insert, after update) { vendorController vencont = new vendorController(); ...
3
votes
3answers
107 views

Getting dynamic Record Type name/id

Is there a way I can find out what recordType the user have selected? I have put together the apex code : private String getRecordTypeSelectedId(String recordTypeName) { String rtId; ...
1
vote
1answer
18 views

Is there a way to capture what RecordType user has picked using apex code

I have few different record-types in my object and I like to know either by Id/Name what record-type the user have selected and based on that record type selection I have to perform some logic behind ...
0
votes
2answers
28 views

Read-only “Lookup” field.

How can I make lookup field as read-only so that the user does not change the lookup field? I'm using custom object and like this to be done using apex code since I'm writing all my business logic ...
2
votes
1answer
22 views

execution of BeforeUpdate caused by: System.StringException: Invalid id

What I'm doing wrong here? I'm creating a new record which is work_order__c and once I created I'm getting the name of the newly created row and updating the vendor__c object ...
-2
votes
3answers
38 views

Updating a field which is a lookup on ather custom objects

UPDATE 3 Here is my complete code I have so far; I have trigger on vendor__c object trigger vendorTrigger on vendor__c (after insert, after update) { vendorController vencont = new ...
1
vote
1answer
39 views

Change account owner on insert/update

I have on the account a lookup field on account named ' '. And two account record types 'RT1' and 'RT2' While adding an account with RT2, I have implemented a trigger to change the account owner with ...
1
vote
1answer
33 views

How do I simulate a checkbox click on a Visualforce page from a Controller class?

I have a Visualforce page with a header section that has a checkbox, and a detail section with a table that has a checkbox in the first column. Based on the data loaded the checkboxes in the table are ...
4
votes
3answers
86 views

Error in using multiple @future methods

I have created a Trigger and Class that works in dev environment, but I'm trying to deploy it to production, and it is testing all of my code with all the other classes in the environment. The only ...
0
votes
1answer
46 views

Help Writing a Simple Test Class

How in the WORLD do I write a test class around this code? I've been able to get a successful test run, but the test says I have no code coverage. All this code does is take 5 text inputs passed in ...
1
vote
0answers
22 views

Serializing/Saving the values of a custom class?

Would it be possible to create a custom class whose values can be saved, and then possibly even reported on, without creating a custom object behind it? The reason I ask for this is because this ...
2
votes
2answers
51 views

purpose of utility class

In my organisation , they ve written a class and in description it says " This is Utility Class " . Actually what is the purpose of utility class ? Why are we using that ?
0
votes
1answer
31 views

Help with test classes for VisualforcePage Redirect controller

I'm very new with apex, and having a lot of trouble getting code coverage for my tests. Here's my Visualforce page: <apex:page standardController="Task" > <apex:enhancedlist type="Activity" ...
3
votes
1answer
107 views

For a new class should i upload meta.xml to github?

I know this is a dumb question but I never faced this situation. When I write a new class and need to push the class to svn/git do I need to upload the -meta.xml file also? or just the .cls file?
1
vote
1answer
47 views

Apex class for trigger

I am writing a test class for Contact record update trigger I tried my best but it's not working, please check and give suggestion to improve my code @isTest public class TestStopEmails { static ...
5
votes
2answers
415 views

How to prevent users from viewing apex code?

There are many apex classes and triggers in my production org. Despite 'System Administrator' being the only enabled profile, (in Develop>>Apex Classes>>"Class Name">>Security) users can still view ...
0
votes
1answer
36 views

Mass transfer approval process

In our case, usually the users request us the approvals pending of a particular user. We go to Setup -> Administration Setup -> Data Management -> Mass Transfer Approval Processes and we manage ...
0
votes
1answer
61 views

Q: Need to add a list but not sure were in the code

I have a Visualforce page. When you selected a product. I need the "OpportunityLineItem.ListPrice" and "OpportunityLineItem.Terms_c" fields to show the value. The only way I can get the system to show ...
-1
votes
1answer
31 views

Constructor not defined: [Asia1Activation].<Constructor>() at line 27 column 31

I have a class that looks like this: public class Asia1Activation { public Asia1__c thisAsia1 {get; set;} public Boolean isSuccess {get; set;} public Boolean isActivated {get; set;} ...
0
votes
1answer
72 views

Attachment Trigger Test Class

Can you please help me with Test Class regarding Attachment Trigger I have. Whenever I run Test Class I get this error below. System.NullPointerException: Attempt to de-reference a null object ...
1
vote
2answers
32 views

Schedulable Class not fetching Email template in Else Part

Here is the class OpportunityReminderMail which is called from Schedulable class i have added one new if statement to choose another template while Service_segment__c = ESR but it is not picking up ...
2
votes
1answer
127 views

Scheduled Apex not consistantly executing, sending emails

I'm having a problem similar to this user's question from about a year ago, although it's not clear to me whether the solution provided there actually resolved the issue (or if it just made the ...
1
vote
1answer
145 views

Apex heap size too large error

Is there any way to make this apex class more efficient? Currently, whenever a case with many case comments is escalated in our system, an error occurs stating the Apex heap size is too large. Any ...
0
votes
1answer
40 views

Apex Class Compiling Error:

Im testing an apex class that I got from Jeff Douglas' page but the I'm getting a "Error Error: Compile Error: line 61:76 no viable alternative at character '%' at line 61 column 76" soql = ...
0
votes
1answer
74 views

Dynamic Way to View Pricebook Entries in their respective Pricebook through Apex?

I have an apex class and vf page that is based on the PricebookEntry object because I want to be able to have a list view of all pricebooks at the top of the vf page and each time a different ...
0
votes
0answers
10 views

API TextVal not always working?

I have an Integration with Brown Paper Tickets to Salesforce (the basic AppExchange unmanaged package), and it seems to be working as expected, unless a person's name in BPT contains special ...
1
vote
3answers
71 views

Update is not working when DML is outside the FOR LOOP

I am having issues when placing the UPDATE outside the For Loop, for some reason is only updating the last selected item in the wrap class, but if I placed it inside the loop it works perfectly. I ...
2
votes
1answer
37 views

How to implement the Sumproduct fuctionality using Apex class

In our project we need to use the Sumproduct Function (Similar to Excel SUMPRODUCT function). How do I implement it using Apex class. Thanks in advance! Cheers!
0
votes
1answer
34 views

Integer declaration

I have below method in a public with sharing class. In the method, I need to use an integer but unable to declare that. Can someone please help me in integer declaration here? Snippet: public with ...
0
votes
0answers
10 views

Is there anyway I can know which all methods are there in the class thru Apex Code? [duplicate]

I want to know if I can get a list of methods that a class contains, and how those methods are invoked. Can anyone help? Thanks in Advance.
1
vote
1answer
113 views

Check if a string substring value is alphabet

I have a requirement to make string values passed as init caps. How to check whether the element I am capitalizing by toUppercase() is an alphabet or not? Please find my code snippet here. Snippet: ...