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

2
votes
1answer
18 views

Can interface have inner classes or interfaces?

Can interface have inner classes or interfaces? Looks like it is not possible and the answer is no, however it is not mentioned anywhere in the documentation ...
1
vote
1answer
21 views

Null String value to hardcode value

I have below piece code where I want to assign 'No Value' to the string (Oldvalue) if it is Null. I have tried it by several approaches like (String.isblank etc), but not getting desired output. Can ...
1
vote
0answers
36 views

Combine two unrelated objects in table

I have 2 object that are not related, object container contains the items(order + upc + expdate make each container unique). Now I am creating a page that will help to find and pick these items based ...
-1
votes
1answer
20 views

Update contact field by all child service [on hold]

I have a Contact and Contract User object. I can create contract user for different service where contract user will contain one contact. Suppose 1 contact have 3 contract user. Following will be the ...
-1
votes
1answer
38 views

how to convert an HTML class to visual force component class

I have a code in HTML and i need to convert it into VF. My HTML code is like <input id="Lname" value="" class="validate[required] text-input" maxlength="40" name="LastName_Web__c" size="20" ...
2
votes
1answer
16 views

Save Pdf as a attachement in Notes and attachment using apex class(Without clicking on Button)

My question is regarding Save Pdf as in Notes and Attachment under the record, So, my issue is, First controller is fill the document(PDF) and Second controller can Save that PDF using that first ...
0
votes
1answer
8 views

Case Feed and default email template assignment

Is there a way in which to assign a particular email template ID to the Case Feed?
0
votes
1answer
34 views

Creating an Apex Class for a default email template

I'm looking for a simpler method with which to set a default email template without having to use Case Status or Case Reason. Instead, I'd like to use just the Case Record Type. global class ...
0
votes
1answer
42 views

Is this trigger working how it is required to?

What this trigger is to do: Get a related list of Opportunity Line Items IF the stage on Opportunity = Closed Won. Once I get this related list, I need to create a new Opportunity with the account ...
0
votes
3answers
35 views

How can i resolve Unknown property 'accounts' referenced in error?

I have created controller and visual force pages. In my controller using field sets it's working fine. My VF pages having problem for unknown property. What should I need to change in my Visual force ...
2
votes
1answer
32 views

Find out which test classes hit a particular class

Does Salesforce have a functionality that lets you identify which test classes (and possibly which of those tests) cover a particular Apex class? I know that if you run a test class then you see ...
1
vote
1answer
57 views

How can i resolve Constructor not defined error?

I have created class using custom setting. I need to retrieve data from custom setting. I am getting constructor not defined error my error line is options.add(new SelectOption)Please find below code. ...
1
vote
2answers
49 views

Can we insert any records in overloaded methods?

I have got a requirement which I have mentioned here I have been asked to create some overloaded methods to achieve this. Something like below. Public Class OverloadedClass { Public Static Void ...
1
vote
2answers
50 views

How can i improve test coverage?

I am new for test class but I have covered 54%.My class having web service i don't know how to write test class to web service. Please can any one help me out.I need to move production.. Apex class: ...
2
votes
1answer
46 views

Can Wrapper Class Objects be used for Trigger Logic?

Working with Visual Force pages recently I've grown to like the benefits of defining inner class objects to store complex data structure as opposed to multidimensional maps. For example I can easily ...
1
vote
1answer
19 views

Test class on a class contained by another class

I have to write a test class for an apex class which look like that : public without sharing class HController{ //public user currentuser{get;set;} public Account personContact; ...
0
votes
1answer
33 views

Test class for trigger that changes recordtype on a sObject dependant on status condition

This is my trigger: trigger contractStatus on Contract (after insert, after update) { Set<Id> accIds = new Set<Id>(); List<Account> newAcc = new List<Account>(); ...
0
votes
0answers
22 views

Need help for writing test class?

I am new for test class but I very eager to learn for that, I have created class. Please can any one help me out to my class. global class Searchaddress { public String ...
1
vote
2answers
24 views

Sets containing hidden duplicates

I have an apex class which updates an Account variable "YearlySales__c" based off of opportunities(from first of the year till now)(it should be run once a year). In this class I use a set to contain ...
0
votes
1answer
31 views

When I click the detail button in visual force page it is showing account record detail page,

When I click the detail button in visual force page it's showing account record detail page.Below mentioned Code and Screen short. I need but code and how to link Deatil Page? Pls Help ME ...
2
votes
2answers
31 views

Base Class or Interface for Custom Settings

Is exist Interface or Base class for Custom setting? I tried use SObject class, but it does not support Custom Settings Methods. For any SObject we can use SObject class, that base class for standard ...
0
votes
1answer
45 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
25 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
28 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
37 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
33 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
47 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
33 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
35 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
35 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
68 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
137 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
23 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
69 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
46 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
62 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
145 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
50 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
79 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
87 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
15 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
96 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
26 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
68 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
27 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
39 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
37 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
35 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
58 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
53 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 ...