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
0answers
22 views

Surprising compilation error: “A non foreign key field cannot be referenced in a path expression: ChangeEventHeader”

Why is it that this will not compile: trigger AccountChangeTrigger on AccountChangeEvent (after insert) { String dmlType = Trigger.new[0].ChangeEventHeader.changetype; ... A non foreign ...
0
votes
0answers
11 views

Apex compile time error handling with VS Code: cross-class compilation errors not getting triggered

I'm noticing some behavior regarding throwing errors (or not) at compile time in VS Code that I think might be different from how MavensMate handled it. Example: // inside TestClass.cls private ...
1
vote
2answers
64 views

SOQL subquery access variables

Attempting to access the variables MIlestone1_Project__c has a Lookup relationship to Account with relationship name: `Projects__r'. List<Account> accList = [ SELECT Id, Name, EHR_Status__c,...
0
votes
1answer
25 views

Trigger code error

I am really new to triggers and not sure how I fix this error, please help. Thank You, Lorr
-3
votes
2answers
63 views

Accessing results from my first SOQL search

My Trigger will send an email anytime one account has 7 cases created within 8 days. Towards the bottom in my Else block, I am trying to access fields in my first SOQL statement. I have tried many ...
-1
votes
2answers
29 views

Send email to List of addresses

Please help with the syntax for my message.toAddresses accepts a List. Error message Initial expression is of incorrect type, expected: String but was: List<String> My Code: List<...
-1
votes
1answer
28 views

Accessing SOQL results

How do I access the fields coming from the Parent_Project_if_applicable__r Relationship? Syntax assistance. List<Case> caseList = [SELECT Id, AccountId, Account.Name,...
0
votes
1answer
362 views

Getting Error “Global variable must be contained inside of a global class”

I have a class which is global and extending another class (which is managed packaged file): global with sharing class cc_b_ShippingAndHandling extends ccrz.cc_api_ShippingAndHandling { double ...
0
votes
1answer
765 views

Adding custom button to custom object in lightning

Followed instruction from DocuSign to add custom button to custom layout in lightning. Any idea why it may not be working? I'm in Sandbox environment. Error: Error: Syntax error Code: {!URLFOR(‘/...
0
votes
1answer
53 views

Constructor Syntax in Batch Class

I'm new to the development side with no real development background in any language. So I wrote this batch class, and I can't quite figure out how to implement the proper syntax for the constructor. ...
0
votes
1answer
205 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
33 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
90 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
89 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
30 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
29k 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 ...
3
votes
1answer
30 views

Formula field with several nested functions - can't get right syntax

Trying to create a text formula field that returns certain texts based on combinations of possible values in other fields. Every time I update the syntax, I get an error message either about ...
-1
votes
1answer
72 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
294 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
133 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
175 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
77 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
54 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
57 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
6k 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
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 ...
2
votes
2answers
276 views

Error: Syntax error. Missing ')' for CASE Statement

I've created a text formula field, but I've been hitting a wall with the CASE portion of the formula: I keep getting the "Error: Syntax error. Missing ')'" message. Here's what I created: Account....
0
votes
1answer
36 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
2answers
181 views

SYNTAX ERROR “)” ON DATE RANGE

I'm trying to segregate records by month name for the first three months of the year. Everything with a date range of 1/1/19 through 1/31/19, should return JAN, for example. I'm getting syntax ...
0
votes
1answer
27 views

Error: Syntax error. On Custom Field

I have the following formula for a Checkbox in Salesforce and it keeps giving me the following error. I am trying to have this box check if "Trip A (or B), 2 Weeks, 1 Week or 3 Days is true along ...
1
vote
1answer
75 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
49 views

Error: Syntax error. Missing ')' in formula

I keep getting 'Error: Syntax error. Missing ')' in my code. Any help would be greatly appreciated. Thank you! if(Owner.Trip_A_1_Week__c=TRUE,TRUE, IF(Owner.Trip_A_2_Weeks__c =TRUE,TRUE, IF(Owner....
0
votes
1answer
43 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 :...
6
votes
2answers
319 views

Syntax guide for working with Salesforce Web Components

I am struggling to find any syntax documentation related to building a Web Component, and could really use some help. For example, in my JS file I make a call to a custom APEX api that returns a ...
0
votes
1answer
588 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
47 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
330 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
3k 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:...
0
votes
1answer
25 views

Variable add on a Javascript controller inside -> component.find(' variable ') markup

I want to add a variable like this. Day value is an Integer var day = component.find('days').get('v.value'); var date1 = component.find('HDate'+day+'__c').get('v.value'); But it returns an error at ...
4
votes
1answer
209 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
102 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
113 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
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 ...
0
votes
4answers
338 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
1k 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
902 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
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 ...
8
votes
0answers
144 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
178 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(...) ...