Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
1answer
32 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 ...
3
votes
1answer
26 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
42 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
22 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
74 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
30 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
47 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
23 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
155 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
34 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
39 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
755 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
106 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
52 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
80 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
62 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
455 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
420 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
99 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
114 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" ...
7
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
387 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
153 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
1k 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
156 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
23 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
122 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 ...
0
votes
1answer
135 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
318 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
504 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
47 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
20 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
76 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
875 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
47 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
761 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
556 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: ...
5
votes
2answers
138 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
220 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
66 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
3k 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: ...
4
votes
1answer
167 views

Numeric input on VF page linked to value of a Map in controller

For one of the requirements I'm building a visualforce page with a controller. The problem is that I can not save the page with <apex:input> type being number. Compilation error is: Expected ...
2
votes
1answer
174 views

Compile all apex class order

Running into an error where dependent classes are invalid and need recompilation because no such column 'BillingAddress' on entity 'Account' exists. One recommendation was to create a class that pulls ...
0
votes
1answer
146 views

Batch test class not working!

I have managed to put together a batch test class using Trailhead, but it is not correct, all I need is for it to populate values in new custom fields with values in other fields all from the Account ...
4
votes
1answer
55 views

Are RecordType Static Resources not Allowed in Apex?

I get the following error when I try to save a test class with List<sObject> recordTypes = Test.loadData(RecordType.sObjectType, 'Record_Types'); "Method does not exist or incorrect signature: ...
0
votes
1answer
139 views

Lightning Component/Inner Class Bug after Spring 18 sandbox update [duplicate]

I have an existing Lightning Component, which is used in a lightning community. This component was version 39 on Friday. The following is a pared down example of the code (I just removed a bunch of ...
6
votes
1answer
116 views

JSON.deserialize() for User records wont work

I'm trying to deserialize a received user record on a JSON format. TO achieve this I'm using JSON.deserialize() but when I specify the User class the compiler throws the following error: Save Error:...
0
votes
1answer
386 views

Method must have a body

I get this error when I try to save the below class. Why? How do I fix it? Error: Method must have a body at line 3 column 27. public class visitController { public Sales_Visit__c visit(); ...
0
votes
2answers
359 views

Method does not exist or incorrect signature: void schedule(String, String, PotentialCustomer) from the type System

I get this error when I run the below code: Method does not exist or incorrect signature: void schedule(String, String, PotentialCustomer) from the type System Code: global class ...