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
2
votes
3answers
137 views

Handler will not compile

I got advice earlier today on how to separate my handler class's concerns so that I can test them better. I cannot get the class to compile and it's killing me inside. The idea is that when a record ...
2
votes
1answer
559 views

Method does not exist or incorrect signature on afterUpdate

I use a framework of a trigger factory to set up all my triggers and handlers of those triggers. Earlier I got some great advice on how to separate my concerns better for the handler. I use this ...
3
votes
1answer
162 views

Newbie - First Apex Class question re: No viable alternative character

I'm doing one of the Trails, converting my .NET and Java knowledge over. I'm stumped on a really simple task. Objective: Return a list of accounts where the BillingState is the same as the state ...
1
vote
3answers
164 views

Apex Inheritance: illegal Assignment

Why is the following code returning an illegal assignment error in anonymous window? Line: 3, Column: 9 illegal assignment from truck to vehicle Super Class public virtual class vehicle { ...
6
votes
2answers
3k 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 ...
0
votes
2answers
26 views

Error: dailyHLAReportDashboardController Compile Error: expecting a right parentheses, found 'Active' at line 6 column 201 [duplicate]

I am trying to query counts of an custom object records but i also need to filter out the records. so when i am using single quotes for where clause getting error as: Error: ...
5
votes
2answers
4k views

Map<Object, List<SObject>> cannot be cast to Map<String, List<Account>>

I'm trying to cast a Map<Object, List<SObject>> to Map<String, List<Account>>, which fails with the error Incompatible types since an instance of Map<Object,SObject> ...
3
votes
1answer
125 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 ...
3
votes
2answers
1k views

Error: Compile Error: unexpected token: public at line 10 column 0

I am a beginner when it comes to Apex and am trying to set up a trigger for Adobe Echo Sign to send a new contract request automatically when a new custom object record is created (something Adobe ...
4
votes
1answer
2k views

DML requires SObject or SObject list type error

I got some advice a couple days ago to improve my batch updater class. I have been working on it but am getting a compile error. I get the error: DML requires SObject or SOBject list type: Map Line ...
1
vote
2answers
65 views

Initial term of field expression must be concrete SObject

I'm trying to see if a user ID is contained in a set. However, I cannot get the class to compile. In my code example, I have the if statement as follows which gives the error: Initial term of field ...
7
votes
1answer
5k views

Checking if element is in a Set

I wrote a method last night that creates a new custom object record that is related to an Account and a User. it works great however, it breaks when there is an already existing record for a user. ...
0
votes
1answer
69 views

Test class unable to find “Method or incorrect signature”

I'm having created a pretty simple test Utility Class. the utility class should create two records: an account and a related child (Legal entity). Legal entity is a master detail relationship to the ...
0
votes
1answer
61 views

Syntax Error while creating a Validation Rule to not allow user to save if field doesn't equal 0% or 100%

I have a section in Opportunities called Pacing and in this section there is a percentage field called Pacing Total. I need to create a Validation rule for this field so that if it doesn't equal 0 OR ...
1
vote
1answer
64 views

Initial term of field expression must be a concrete SObject: List Line item

trigger OpportunityUpdateTrigger on Opportunity (after update, before update) { for(Opportunity o : trigger.new ){ for(Opportunity old : trigger.old){ List<OpportunityLineItem&...
0
votes
1answer
2k views

salesforce trailhead TOPIC: Display Records,Fields and Tables

I am new to salesforce platform, i am solving trailhead challenges i came across the error .solve this error error:<apex:component> is required and must be the outermost tag in the markup at ...
0
votes
1answer
964 views

Group By in Soql

I need to group data on the basis of two fields "description" and "createdDate" in soql. Select Subject, WhatId, what.name, Owner.name, Owner.Id, IsVisibleInSelfService, ActivityDate, ...
1
vote
1answer
863 views

Messaging.SingleEmailMessage method compiles anonymously but not in a class

Here's the issue: I'm trying to use the method Messaging.SingleEmailMessage.setEntityAttachments(List<Id>) in a class, but it won't compile. However, when I run the same code in anonymous apex, ...
0
votes
1answer
211 views

Date Format Issue on VF Page

I am trying to change the Date Format on VF Page but it is giving me the following error The value attribute on is not in a valid format. It must be a positive number, and of type Number, Date, ...
1
vote
2answers
411 views

Invalid type: JSON.createGenerator

We have the following: Source SFDC Org: making a REST Callout towards SFDC Target Org Target SFDC Org: Custom PUT Webservice being referenced from the Source SFDC Org Source SFDC Org Future method ...
1
vote
2answers
934 views

What is the correct way to type cast a dynamic SObject?

I'm trying to get the object type conversion as below. But getting compiler error saying Invalid Type t. Any clue to correct it. Thanks. obj_Name is String and Formobject is SObject. Type t = ...
2
votes
1answer
38 views

Save error: Constructor not defined: [Sample11.EventData].<Constructor>(Id, Datetime, Datetime, String)

I'm trying to expose user related events using REST API but I get the error at line 33. Why? Error Line: EventData eveData = new EventData(eve.Id,eve.StartDateTime,eve.EndDateTime,eve.subject); ...
1
vote
1answer
99 views

for loop query to populate lookup

I am upserting a custom object record and I want to populate a lookup field. My thinking is that I need to do a query in the for loop get the id then push that to an id variable (externalid). Then ...
1
vote
3answers
3k views

record type name insert in test class

Record Type Label: Lead/Opportunity Rule Record Type Name: Lead_Opportunity_Rule throw an error Compile Error: Initial term of field expression must be a concrete SObject: String String recType ...
3
votes
2answers
927 views

Compile error: Variable Does not exist while attempting JSON deserialize

Not sure if this is a platform bug or by design feature with case insensitive variable names?, but it gave me a lot of trouble so wanted to post a question about it to document the workaround I found. ...
1
vote
1answer
502 views

Unable to call method from static WebService method

I am at a loss as to why I am running into issues here. I am trying to simply make a call to a method within a class, from a web service method. The error I continue to get is: Save error: Non-...
2
votes
1answer
294 views

Why does it say 'method does not exist' in my Apex code?

I have a class with this method, which I borrowed from another answer here on Salesforce Stackexchange: public String removeHtml(String stringWithHtml) { String cleanString = ''; if (...
0
votes
1answer
122 views

Compile Error: Non-void method might not return a value or might have statement after a return statement. at line 11 column 9

I am not sure what is wrong in my code, but I get the following compile error: Error: Non-void method might not return a value or might have statement after a return statement. at line 11 column 9 ...
2
votes
1answer
72 views

Why does this VisualForce page think I'm referencing a Controller variable, instead a field inside of that variable?

Assume that I have a VisualForce page that looks like this: <apex:page controller="SearchResultController" action="{!storeSearchResults}" id="SearchResultsView"> <apex:repeat value="{!...
0
votes
1answer
1k views

Compiled formula is too big to execute error

Is there an alternative way to: Add "$" prefix to the product of (SHIPPING FEE * USD CONVERTION RATE) ROUND UP (SHIPPING FEE * USD CONVERTION RATE) to the nearest 10 dollars or nearest 100 dollars ...
0
votes
2answers
30 views

show an query error

I have a test class its shown an this error System.QueryException: unexpected token: 'BY' in this line don't get what exactly wrong with this statement public static List<PO_Line_Item__c> ...
3
votes
2answers
809 views

“Variable does not exist” Error While Reference a Package Namespace

Solved? The root cause is my inaccuracy in object initiating: i just forgot to add new. But the misleading error message is still in place. So other APEX devs may hit the same issue. Initial ...
1
vote
1answer
26 views

Apex Class compile error: Initial term of field expression must be a concrete SObject: Map<Id,Application__c>

I have a relatively simple apex class that is failing to compile. Please take a look and let me know if any of you have thoughts on what could be causing the issue... public class ...
1
vote
2answers
31 views

Initial Term of field expression mist be a concrete SObject

I want to update 2 fields on a Product record when a field is populated. The values I want to pull in are from another object so I believe the correct way is to get a filtered list of records from the ...
0
votes
1answer
352 views

Compile Error: No such column 'What' on entity 'Task' [duplicate]

I have written a trigger on case, to prevent closing the case when all the associated tasks are not closed. Facing this error while saving the trigger: Error: Compile Error: No such column 'What' ...
0
votes
1answer
1k views

Compile Error: Only top-level class variables can be declared static

@isTest private class TestRejectDoubleBooking{ public void TestSingleBooking(){ static testmethod void TestSingleBooking() { Datetime now = System.now(); Speaker__c speaker = new ...
1
vote
2answers
6k views

Illegal assignment from list to list (OpportunityContactRole to String)

I'm receiving the following error: Illegal assignment from List<OpportunityContactRole> to List<String> When I try to query from OpportunityContactRole and store it into a new list. I'...
2
votes
1answer
257 views

autocomplete form using Apex and VF

I was working on the autocomplete feature for which I have this controller and page. Controller: public class autoCompleteCon { public List<String> listOfStrings {get; set;} // ...
1
vote
1answer
141 views

Why do I get “method doesn't exist or bad signature”?

What am I doing wrong here? I have an ApexClass named SearchController, which starts with: public class SearchController and which includes these two methods: public void save_search_results(...
0
votes
0answers
154 views

Compilation Error: ChatterAnswersAuthProviderRegistration

I'm trying to validate a new apex class, but ran into a slew of test failures. Afterward I went to compile all my classes and got the following error (same error I get with the aforementioned ...
1
vote
2answers
95 views

Compile error for scheduled apex test class (expecting a right parentheses, found)

I'm getting the following error when trying to save my test class for a schedulable class: expecting a right parentheses, found 'Test' Here's the main class: global class deleteConvertedChatter ...
0
votes
2answers
580 views

IF THEN Statement in VisualForce Email Template

I am trying to create an If statement that will output the date of TimeclockStartDate__c if it has a value and to not output anything if the field is left bank. I am getting an error: "Syntax Error" ...
0
votes
1answer
1k views

Compile Error: Invalid bind expression type of List<String> for column of type String

I have a req. to map The URL that is stored in the field which holds the url of the image in the documents. In VF page I reference the field that will hold the url from the documents. So I created a ...
1
vote
1answer
3k views

How to fix this Compile Error: Expression must be a list Type

First, let me say that I did not write most of the code below. I am trying to deploy additional Apex code and this code, written by my predecessor, is failing Apex tests when I try to deploy my change ...
3
votes
1answer
1k views

Invalid field RecordTypeId for SObject Case

This evening I finally started working on an Apex Specialist Superbadge. I followed all the steps to prepare the developer org and started coding, however, I can't compile my code due to this weird ...
-1
votes
1answer
73 views

Trying to access a child object using a query but getting a compile error

Here is my Trigger trigger DailyTaskTrackersTrigger on Daily_Task_Tracker__c (before insert, before update,after insert,after update){...
2
votes
1answer
1k views

Root cause for “Entity is not org-accessible” for sharing object?

Not able to find Sharing object for custom object Apttus_Proposal__Proposal__Share; giving me error while List<Apttus__APTS_Agreement__share> st = new List<Apttus__APTS_Agreement__c>();
5
votes
2answers
293 views

“Entity is not api accessible” vs. “Variable does not exist”

I've seen this error before many times, occasionally even in my own code. Entity is not api accessible It seems like often the compiler thinks you're looking for a standard object and it can't ...
3
votes
2answers
1k views

Expecting right curly bracket, found 'else'

I am using if else loop in my method, facing this error while compilation. Expecting right curly bracket, found 'else' Here is my method: public List<SelectOption> actionTypeOptions { ...
0
votes
1answer
5k views

Only top-level class methods can be declared static

I'm really hoping someone can help me here. I have tried numerous times with this code but still get the same error. I have even used other code I have found on-line that apparently 'works', but with ...