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
118 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
24 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
64 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
51 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
27 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 ...
-1
votes
1answer
56 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
196 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
126 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
136 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
52 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
47 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
41 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
1answer
77 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
33 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
72 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
36 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
459 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
39 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
272 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
2k 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:...
4
votes
1answer
174 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
99 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
107 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,...
0
votes
4answers
220 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
987 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
787 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('...
8
votes
0answers
131 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
159 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
451 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-...
-3
votes
1answer
205 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
251 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
223 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
48 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 ...
0
votes
1answer
176 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
408 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
539 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
2answers
59 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 ...
1
vote
1answer
22 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
95 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
53 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
1k 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&...
2
votes
1answer
658 views

List.indexOf does not exist?

I have an error in a method using List.indexOf. When running in anonymous window in sandbox, it works. But in production I get the following error: Method does not exist or incorrect signature: ...
4
votes
2answers
160 views

When (if ever) will testmethod fail to compile?

I just recently learned from the Apex Developer Guide documentation on the IsTest Annotation: The testMethod keyword is now deprecated. Use the @isTest annotation on classes and methods instead. ...
-3
votes
1answer
352 views

Inserting AccountTeamMember on Account

trigger AccountTeam on Account (after insert) { if(Trigger.isInsert){ for(account acct : Trigger.new){ if(acct.ParentId!=null && acct.VPA__c==false){ ...
2
votes
1answer
78 views

StateCode, CountryCode fields not available in SalesforceDX

I am trying to switch to DX but noticed that the CountryCode and StateCode are no longer being recognized by Salesforce in DX environment. Trying to reference those fields gives me an invalid field ...
7
votes
1answer
4k views

Method does not exist or incorrect signature: void contains(String) from the type List<String>

I cannot figure out why the following code (which is within a Test Data Factory class) would cause this error when validating in Production for deploy: Method does not exist or incorrect signature: ...