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
30 views

How to insert a record using table?

I have a table of 3 rows and 3 columns in which the data I enter should be saved in the account object. But what I am facing is , only the 3rd row data is inserted not the first two. My controller ...
0
votes
0answers
23 views

Trigger is not working

I am new in salesforce and i am trying to get regions to Auth Object From Contact's county.County object has county and region and Contact object has a lookup to County object. Auth object has a ...
0
votes
0answers
41 views

Multiple conditon in script tag [on hold]

Please find below script tag directly fed in my apex page. I need to check for multiple conditions to disable an input field. It is not working.Here 'out' is the id for inputfield. I do need something ...
0
votes
0answers
21 views

Save error: Method does not exist or incorrect signature:

I have a interface and have implemented the interface to a class. Now I have created the variable and trying to call the class from the class, at the time I am getting this error Save error: ...
0
votes
3answers
31 views

Apex : CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY & SELF_REFERENCE_FROM_TRIGGER

I added a new field on Opportunity table to keep a count of records, as well as track the updates made on that record. This is needed for an external system we use. Opportinity table already has ...
0
votes
1answer
25 views

Constructor error message on test class for pagination

I have a visual force page to display a list of locations. I used pagination and wrote class for it and working finely. but the test class is giving me an error : Constructor not defined: ...
0
votes
2answers
43 views

Populating Field From Other Object

Hi i am new in salesforce and i want to ask a question about populating field from other object. There are 2 objects AreaFee and Account. AreaFee contains pdfCode(text),area(text),fee(currency) as a ...
0
votes
1answer
29 views

Redirect to detail Page not working

Please find my below code where Redirecting to Detail Page is not working based on boolean value. Can someone please let me know the root cause? Apex Controller: public class CallReplica_controller ...
0
votes
0answers
31 views

Opportunity analyze

I need an analyze of our opportunities for each team in our org. First I select the team and then should the visual page show a table of all accountOwner of this team and the different recordtypes ...
2
votes
2answers
30 views

Load an Apex class structure dynamically

Looking for a way to dynamically set a class structures fields by list or map of the string version. I know we can do this with Objects. Here is kinda of what I am wanting to do. This is a simple ...
1
vote
1answer
39 views

Get Data from batch iterable

Good day everyone, Maybe this question is basic for everyone but I'm having a problem with it, so I'm asking for help. I have created a BATCH ITERABLE . global with sharing class batchProcessor ...
1
vote
1answer
122 views

dynamic datatable

I want to create a datatable with opportunity information. I add a picture that shows how the table should look like. I have the information for the table ( below is my class code), but I don't know ...
1
vote
1answer
20 views

Trigger to insert line items for all child products of a parent product [closed]

My data model has a custom object called Bids that is supposed to be like standard Quotes. Every Bid can have multiple Bid Line Items (master-detail), where each Bid Line Item represents a Product. ...
1
vote
0answers
29 views

FIELD_INTEGRITY_EXCEPTION, Chatter Answers User is not allowed for this License Type

FIELD_INTEGRITY_EXCEPTION, Chatter Answers User is not allowed for this License Type On my test class, I am getting the following error. System.DmlException: Insert failed. First exception on row 0; ...
3
votes
2answers
43 views

Retrieve List from Class to use in Trigger / Class, without an SOQL query

I would like to manage the validation of my record's RecordTypeIds, against the valid Ids which are listed in a Custom Setting, in a Class. Based on the answer to this question How to get values from ...
3
votes
1answer
59 views

Creating dynamic Constructors to receive inputs from 2 or more objects

Every time one of my records which has a Trigger is changed, I'll need to check whether the record's RecordTypeId is listed in a Custom Setting, before calling any other methods from the Trigger. ...
2
votes
2answers
69 views

Test Method That Accepts Date Parameter Doesn't work

I'm posting the challenge question to the Trailhead Beginner 'Apex Unit Tests' module. Install a simple Apex class, write unit tests that achieve 100% code coverage for the class, and run your Apex ...
0
votes
1answer
44 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
67 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
80 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
13 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
62 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
21 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
42 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
19 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
25 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
33 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
31 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
54 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
51 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
36 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
21 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
23 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
42 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
115 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
26 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
156 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
21 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
29 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
38 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
41 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
47 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
62 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
112 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
51 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
23 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
107 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
40 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
109 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 ...