Questions tagged [compile-error]

Compilation error refers to a state when a compiler fails to compile a piece of computer program source code, either due to errors in the code, or, more unusually, due to errors in the compiler itself. A compilation error message often helps programmers debugging the source code for possible errors.

Filter by
Sorted by
Tagged with
0
votes
1answer
33 views

Illegal conversion from String to System.HttpResponse

I Have the class AnimalLocator and a method getAnimalNameById HttpResponse response = http.send(request); if(response.getStatusCode() == 200){ Map<String, Object> results = (...
0
votes
1answer
18 views

List<List<SObject>> in apex:attribute type

My visualforce component has the following attribute: <apex:attribute type="SObject[][]" name="var" description="Variable to store results in." assignTo="{!searchResults}" required="true"...
1
vote
1answer
29 views

Why is this SOQL query giving error saying variable does not exist

I am getting error saying variable SBQQ__LineItems__r does not exist when I try to have values saved in the List with below SOQL on CPQ. What could be the issue here: List<SBQQ__Quote__c> qte = ...
0
votes
1answer
25 views

Error: Invalid Type

What is it I am doing to get the invalid type error? public with sharing class MyController { public list<JSONWrapper> wrapper {get;set;} public integer appTotal{get;set;} ...
0
votes
1answer
26 views

Apex method fails to execute

There are 2 classes: Dataclass and Sortclass. The Dataclass is processing and storing data. The Sortclass must sort data. But when I call the sorting method from Sortclass I get the error: "Method ...
4
votes
2answers
25k views

Static method cannot be referenced from a non static context: List<String>

I believe this is a basic query and am missing something out. However am exasperated finding an answer to the issue and thus seek your guidance. The intent is to create a static method ...
-1
votes
1answer
45 views

Error — Class ContactBatch must implement the method: System.Iterable<SObject> Database.Batchable<SObject>.start(Database.BatchableContext)

I am getting error in below code. Class ContactBatch must implement the method: System.Iterable<SObject> Database.Batchable<SObject>.start(Database.BatchableContext) Code: global ...
2
votes
1answer
110 views

System.StringException: Unexpected end of expression

Error: Line: 3, Column: 1 System.StringException: Unexpected end of expression. Class: public class OppSchedule implements schedulable{ public void execute(SchedulableContext sc){ ...
4
votes
1answer
124 views

SOQL Not Recognizing Field?

I have this apex code: //testing code for above List<Contact> contacts = new List<Contact>(); for (MtgPlanner_CRM__Transaction_Property__c lo : [SELECT MtgPlanner_CRM__Borrower_Name__c, ...
-1
votes
1answer
92 views

Error: Compile Error: Found punctuation symbol or operator '%' that isn't valid in Apex. at line 14 column 362

global class ABI_SFA_TAC_Removal_Batch implements Database.batchable<sObject> { // variable decleration. public String Query; /* Method Name: Start Description: This ...
2
votes
1answer
40 views

What is wrong with my Flow Interview?

I am working on including a Flow via Custom Button, and so I created a Visualforce Page which includes a <flow:interview> component and references a Flow.Interview on an extension. Page <...
-1
votes
1answer
43 views

Illegal Assignment List to List - Custom Class in Test Class

In an apex class and test class I have a custom class that I use to compile custom attachment result records. public class attachmentResult{ public string name {get;set;} public string ...
2
votes
1answer
29 views

TimeZone.getTimeZone(tz) where String tz equals a supported (I think) timeZoneIdString throws 'Method does not exist or incorrect signature' error

Converting code to utilize the TimeZone class for easier maintainability. For now, I'm stuck relying on a pseudo-timezone field on contacts (c.Time_Zone__c below) to make the determination and setting ...
0
votes
2answers
5k views

How to update existing opportunity field value

I am trying to replace opportunity field value using apex class, public class update_system { public static String saveData(){ for (Opportunity opp : [SELECT Id,system__c FROM Opportunity ...
0
votes
1answer
75 views

We want to get a list of lead and opp. that have the same date (custom fields) in the record as the actual shown lead

What we did so far... We created a visual force page that calls a class and added an extension to get the ID. We got some Error :) (We try to get the ID for the currently displayed Lead, which ...
0
votes
1answer
31 views

soql Expression cannot be assigned

list<dnc_suppression__c> dncsup = new list<dnc_suppression__c>(); dncsup = [ select id, vin__c, DNC_Owner_Ind__c, First_Name__c, Email_Ind__c, Campaign_ID_1__c, ...
1
vote
1answer
66 views

Save error: Method does not exist or incorrect signature: void includes(String) from the type String

I've been receiving this error and need some help resolving it. for(LP_TFL__c tfl : termForLoanList0) { for(ScorecardTier scorecardTier : scorecardTierList0) { //Compare Tiers String ...
0
votes
1answer
31 views

Where to look for in debug: list index out of bounds

I am trying to debug a piece of code where I get the error : list index out of bounds: 0 In this case do I need to look for:ZcheckoutBaseFor.validateConfiguration() or could this also be :...
0
votes
1answer
365 views

Invalid character in identifier

I am getting an error on my JSON2Apex class: Error:(7, 18) Invalid character in identifier: Holding_to_Fund__r Error:(44, 19) Invalid character in identifier: Holding_to_Fund__c I need to parse ...
0
votes
1answer
37 views

Unknown property when using html-data-id attribute in apex:dataTable

I am getting a unknown property error, when using the var from data table in a html-data-id attribute, it is working in apex attributes perfect. I can't figure out how to make it work for html-data-id ...
0
votes
1answer
199 views

Variable does not exist: Quantity

Variable does not exist: Quantity Although it does exist as I added a value to it and it worked fine this is the code @isTest public class AssetTriggerTest2 { @isTest static void test(){ ...
0
votes
2answers
1k views

Getting an “Invalid Definition for Null” error when trying to associate controller with component

I'm creating a lightning component named "scroll" and a controller file associated with it. Here's the opening tag of .cmp file: <aura:component controller="scrollController" implements="force:...
3
votes
1answer
147 views

Not being able to access Flow variable in Apex class

I am trying to create a flow which creates an account record and then navigates to the newly created record detail page VF Code <apex:page Controller="AccFlowController" TabStyle="Account"> &...
0
votes
1answer
87 views

Batch Scheduler Error

I have Created a batch scheduler which need to run for Every 5 min. but i am getting this error. can any one please help me out. Error: Compile Error: Method does not exist or incorrect signature: ...
2
votes
1answer
93 views

SObject List syntax error

In Execute Anonymous, I'm trying to bulk-process a list of sObjects by passing a list to the DML operation with multiple fields. When I just define the 'Name', it works. When I add Field1 and Field2,...
3
votes
1answer
110 views

Sandbox “Caching” Issue - Slow First-Record Access

This is a problem I've dealt with randomly for many years now. At my new company, our Full sandbox has what I like to call a "caching" issue. I know no other way to describe it. Every morning, I am ...
0
votes
4answers
139 views

How to skip Required fields upon auto-creation of an object record?

I have this situation where I want to create a record on the ACCOUNT object and only when my custom field in ACCOUNT called 'Account status' is changed from 'new' to 'prospect', then it should auto-...
4
votes
1answer
768 views

Variable not visible

When I try to save the code (API version 43), I keep getting a compile error stating: Error: Compile Error: Variable is not visible: testClass.XYZ at line 5 Here is the class: global with sharing ...
2
votes
1answer
630 views

illegal assignment from object to id Error?

I have written following code to insert records on junction object. public static List<PDCN__c> addSelectedPDCNs(List<String> selectedRecords, String groupId) { system.debug('...
6
votes
2answers
2k views

Cannot Return a List of Strings - Void method must not return a value

I've been using the notes from Simple Apex class to return a list of strings. I am having trouble getting this code to work. I'm writing a simple Apex Class as part of the Trailhead module Getting ...
8
votes
0answers
121 views

@deprecated annotation issue in Managed Apex

We have 2 managed packages. Let's name those MPMAIN and MPCHILD. MPCHILD package is dependent on MPMAIN. In MPCHILD we have a class: @deprecated global class ChildClass extends MPMAIN.MainClass { ...
0
votes
1answer
145 views

Constructor not defined executeBatch trigger to pass ID to batch class

Ok...trying to write my first class and trigger and running into a wall that I can't seem to get over on my own. Use case: on a custom object called manufacturer__c, when a field goes to "in Process" ...
6
votes
1answer
262 views

Any way to qualify a custom class to distinguish it from a property?

This problem comes up when you try to remove clutter from names because Apex is case insensitive so xyz and Xyz are not distinguishable: public class Xyz { ... private static Xyz[] query(...) ...
2
votes
2answers
422 views

Does Enum support hyphens?

I am trying to create an enum datatype for relationships in my apex class. Below is the code I am using: public Enum Enum_RelationShipCode {Father, Mother, Brother, Sister, Uncle, Aunt, Brother-In-...
0
votes
2answers
3k views

Error: Compile Error: Condition expression must be of type Boolean at line 8 column 9

Error Error: Compile Error: Condition expression must be of type Boolean at line 8 column 9 Class public class DataenteringVF2 { public string name {set;get;} public string lastName ...
-3
votes
1answer
186 views

What's the solution on the errors in apex?

Missing return statement required return type: List Illegal assignment from System.PageReference to String Illegal conversion from String to List Variable does not exist: cCaseId ...
10
votes
2answers
2k views

What is the best way to cast/convert Map<String, SObject> to Map<Object, Object> and back again?

To reduce code duplication, at the risk of type safety, I have some method: public Map<Object, Object> doSomething(Map<Object, Object> inputMap) { Map<Object, Object> outputMap; ...
1
vote
1answer
210 views

Recompilation Issue When Pushing To Production

I have a class that I updated and am pushing to production. When I validate, I am getting this error for all 300 classes in production: line -1, column -1: Dependent class is invalid and needs ...
2
votes
1answer
26 views

Unexpected token error for apparent valid assignment?

What is wrong with this test class? I'm getting the error: Error: Compile Error: Unexpected token '='. at line 7 column 19 This is at "email.subject = ..." What is possibly wrong with this ...
0
votes
1answer
182 views

Variable does not exist when trying to access 1st element of list

Below i the code : Map<String,Object> poVals = (Map<String,Object>)JSON.deserializeUntyped(POResponse); system.debug('poVals' +poVals); lstPODetails = (List<object>...
-1
votes
3answers
46 views

how can i create an account on button and pass the id's account?

I'm very new to Salesforce Development and I am struggling to figure this out. So i want to create 2 VF pages and 2 controllers and I want to create new account and insert that account when I'm ...
1
vote
2answers
55 views

compiler Error : Invalid type: Cache.OrgPartition

I am trying to use Platform cache via Apex Code. 1. Created a new platform cache partition in my org - 10MB assigned to Org Cache. Then created a simple apex class via dev console to access the ...
0
votes
1answer
150 views

Variable does not exist: MasterRecordId

below is the code trigger efs_ProjectTrigger on Project__c (after delete) { Set<ID> ProjectIds = new Set<ID>(); for(Project__c Proj:trigger.old){ if(Proj.MasterRecordId!=null) ...
0
votes
1answer
373 views

Invalid loop variable type expected Id was GroupMember

I am trying to write a trigger that will share a record that is created on a custom object(Split__c) with all the groups the record creator is part of. The reason for this is to share the record ...
-3
votes
1answer
520 views

Non static method cannot be referenced from a static context

I am trying to save the below code and getting this compile error: Non static method cannot be referenced from a static context: String System.HttpResponse.getStatus() at line Specific error line: ...
1
vote
1answer
21 views

Test Class calling Rest Resource with List containing multiple variable types

I have a RestResource class that is called by our backend to perform a specific action. The problem is that when I attempt to test for this class, I run into a snag. The Class accepts a JSON file from ...
2
votes
1answer
90 views

Need help with apex trigger to update/delete attachment id on custom field

I am trying to create a trigger that will update or delete a specific field in salesforce Products object accordingly. If there is image in the attachment to add the id and delete the id if there is ...
0
votes
1answer
1k views

Compile Error: Class Batch_Class must implement the method: void Database.Batchable<SObject>.execute(Database.BatchableContext, List<SObject>) [duplicate]

global class Batch_Class implements Database.Batchable<sObject>{ public String Field; public String Query; public String Value; public Batch_Class (String f, String q, String v)...
0
votes
2answers
51 views

Error on TestClass using Custom Controller

Getting an Error: Constructor not defined: [MyController].(ApexPages.StandardController) No error when changed to : MyController controller = new MyController(); but getting error on test Class: ...
0
votes
1answer
939 views

Variable does not exist: Name?

Why am I getting this error? How can I fix it? Error: Compile Error: Variable does not exist: Name at line 8 column 87 Code: trigger DuplicatePrevention on Account (before insert) { List&...