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
-1 votes
1 answer
27 views

Workflow rule to update contact field. Syntax error missing ")"

I have a custom object with a picklist field. When the picklist is selected I want a field on the contact object to be filled with the selected value. I am trying to create the formula for the rule ...
user avatar
-1 votes
1 answer
48 views

Flow formula expression is invalid: Syntax error. Found ')'

I am also running into the same error The formula expression is invalid: Syntax error. Found ')' I am trying to create a formula in a flow. IF ( {!radio_Please_select_a_product} == {!...
user avatar
-1 votes
1 answer
29 views

How do I assign objects and get foreign keys etc

Here's a basic function I have. I don't regularly use Apex, so I'm not sure how to address the various parents and children of objects and assign them, I'm sure there's a tricky bit with the Ids. ...
user avatar
0 votes
0 answers
45 views

"Dependant class invalid needs recompilation" error after upgrading to API version 53

I have upgrade some classes in my org to version 53, while deployment i get the error " Dependant class is invalid needs recompilation". As per the Salesforce article I have tried compiling ...
user avatar
3 votes
1 answer
60 views

Dynamic list using ternary if are not accepted by apex

Considering the code snippet: .. List<SObject> lstSObject = sentence == true ? List<typeA__c>() : List<typeB__c>(); Salesforce doesn't explain much as this operator should be ...
user avatar
  • 115
1 vote
1 answer
61 views

struggling with getSObject / get syntax

Given the following output for JSON.serializePretty(record) : { "attributes" : { "type" : "Work_Order_Product__c", "url" : "/services/data/v54.0/...
user avatar
  • 51
1 vote
0 answers
57 views

NavigationLinkSet can't be reach from LWC component

When I am using NavigationLinkSet object in my apex class, and importing any other method from that class in my LWC component - I've got an error: 'Error:(1, 1) FIELD_INTEGRITY_EXCEPTION - Invalid ...
user avatar
-3 votes
1 answer
72 views

Why I am getting error : A non foreign key field cannot be referenced in a path expression: AccountId?

I want to set the Description field on Contact object same as the Industry field on the Account object. But when I am executing the below code I am getting error A non foreign key field cannot be ...
user avatar
  • 1
3 votes
1 answer
79 views

Getting a formula validation error, can anybody spot where I am off?

IF ( AND ( ts2__Job__c.Days_Search_Open__c >= 0, ts2__Job__c.Days_Search_Open__c <= 4 ), "0 - 4", IF ( AND ( ts2__Job__c....
user avatar
  • 31
0 votes
0 answers
82 views

Compile Error: Type is not visible: ConnectApi.Wave

I am trying to execute a SF Einstein Analytics dashboard query from an Apex class. currentQuery = ApexPages.currentPage().getParameters().get('query'); ConnectApi.LiteralJson currResult = ConnectApi....
user avatar
  • 61
-3 votes
2 answers
136 views

Missing return statement required return type: Integer Apex

When I'm trying to delete some records and get the count of number of records deleted, I'm facing below error: Missing return statement required return type: Integer public static integer ...
user avatar
-2 votes
1 answer
618 views

Method does not exist or incorrect signature...?

I'm trying to deploy/validate a class but getting this error, even though the class is working in the sandbox. Method does not exist or incorrect signature void buildHTTPRequest(String,String,String,...
user avatar
  • 3,730
0 votes
1 answer
142 views

Salesforce- Apex error Unexpected Token

I am having a hard time writing an Apex script properly to remove all users assigned to a permission set called E2CP Case Feed End User. Here is what my error is (in Copado): ERROR Unexpected token '...
user avatar
0 votes
2 answers
351 views

Multiple Checkboxes in Formula Field IF OR AND

I have a Flow screen with 29 checkboxes. Based on 1 or many selected, I need to create a formula, that evaluates when the checkbox is checked, put some text, if not checked, no action (except go to ...
user avatar
1 vote
1 answer
33 views

Error in initializing sObjectField

I am new to Apex coding any help would be greatly appreciated. This is an update trigger and I am trying to check if the hard-coded field lists were updated. However, I am getting an error in the ...
user avatar
1 vote
1 answer
304 views

I am getting an error: Incorrect argument type for function 'ISBLANK()'

I am getting a Syntax error for ISBLANK. I am trying to configure an automation that if I have a checked box on the customer page ("SandSafe" is the check box name) then when users create ...
user avatar
1 vote
1 answer
231 views

Recieving error "Unexpected token '<'." while defining a list in anon apex

The following code returns the error: List<ContentDocumentLink> docLinks = [SELECT ContentDocumentId FROM ContentDocumentLink where LinkedEntityId in ( SELECT Id FROM Case ) and LinkedEntity....
user avatar
0 votes
0 answers
23 views

I'm geting compilation error on below code

trigger ChildTrigger on Child__c(before insert,after insert,before update,after update,after delete) { decimal val = 0; if(Trigger.isAfter && Trigger.isInsert){ try {...
user avatar
5 votes
1 answer
64 views

Compiled size of formula field error when using unlocked packages

So I was working on a task to package some metadata using the unlocked packages that I retrieved from an org. Some of the metadata are objects and they have different field types, of them are formula ...
user avatar
1 vote
1 answer
500 views

Any risk in recompiling all Apex classes in org?

Running into an issue with a deployment, getting a ton of errors of the following flavor: line -1, column -1: Dependent class is invalid and needs recompilation: Class MeansRegisterCustomerTest : ...
user avatar
0 votes
1 answer
463 views

Problem with Safe Navigation Operator

I'm trying to understand and use safe navigation operator . So, this is the original line - List<Opportunity> oppList = (List<Opportunity>) Database.query(query.toSOQL()); return ( oppList....
user avatar
  • 517
0 votes
2 answers
2k views

Unexpected token error in If statement in LWC Javascript controller

This is a basic javascript question. FYI the context is: It is in a Javascript controller for a Salesforce Lightning Web Component, editing in Visual Studio. The code is for selecting a set of table ...
user avatar
  • 322
7 votes
1 answer
466 views

Class <classname> : Expression is too long, please split this expression into multiple statements

I have never seen this error before. It comes up when trying to run a test in Production. It happens when promoting the class (with just some capitalization changed, so it's not a real change) to ...
user avatar
  • 5,608
1 vote
2 answers
47 views

Error: /apex/lightningAccountLayout: Syntax error and Syntax Error

I'm running into these two errors and am not sure why. Any suggestions? Error: /apex/lightningAccountLayout: Syntax error Error Error: Syntax error I'm new to SF, and just learning Apex. I'm also ...
user avatar
0 votes
1 answer
59 views

How can I escape the the double quoted xml in AMPscript

After I use http call to get xml from an endpoint, i got this xml; "<root><listing bedrooms="3" bathrooms="2.0" /><listing bedrooms="" bathrooms="...
user avatar
4 votes
2 answers
2k views

Lightning Web Component (LWC) Class Definition Syntax

Lightning Web Components (LWC) are made up of multiple files in a bundle. For this question I am focusing on the component's main .js file where the web component js class is implemented. Example code:...
user avatar
  • 543
0 votes
2 answers
92 views

Why is there a need for parenthesis on the right side of the equal sign when assigning a Map variable?

I have a question regarding the second portion of this code snippet. When using the "Map<String, Object>" assignments, why is it that I have to use parentheses around the Map<...
user avatar
-1 votes
1 answer
86 views

"Variable does not exist" error in catch block even when the variable is outside the try block

I have written a batch class and using try-catch in its execute method. But on saving the class, getting variable does not exist error. Sample code is given below: global void execute(Database....
user avatar
0 votes
1 answer
175 views

Loop must iterate over collection: Account

In the code below, I get compiler error on Loop must iterate over collection: Account Can anyone help me about this issues. list<Account> acc =[Select Id, (Select Id, Name from ChildAccounts) ...
user avatar
0 votes
1 answer
444 views

Comparing dates (Months) in a IF Statement

I need to compare two dates in Months in Salesforce Opportunity opp Target targ If (Month(Opp.closeDate)== Month(targ.Target Date) { Add the target Id in Map } And the Id will be Queried in SOQL.This ...
user avatar
0 votes
1 answer
18 views

Compile error in Controller

Error: Compile Error: Expecting "]" but was "AND" at line 30 column 133 accounts = [SELECT id FROM account WHERE id=: acc.id LIMIT 1]; tot=totalRecs = [select count() from Asset WHERE Status = '...
user avatar
  • 35
1 vote
1 answer
53 views

Syntax for rule with multiple pick list

I'm new to creating validation rules and am having problems with the syntax. I want to trigger an error message if a picklist question is not answered when closing an opportunity. I have viewed ...
user avatar
1 vote
1 answer
2k views

Illegal assignment from integer to string Error received

I am getting Illegal assignment from integer to string Error *//Map declaration* Map<String, integer> PhoneMap = new Map<String, integer>(); *//adding Map values* PhoneMap.put('IPhone',...
user avatar
  • 11
0 votes
1 answer
47 views

Error: Syntax error. Missing " on billing state in account object

I'm trying to assign a territory based on BillingState field in Salesforce and getting syntax error message Error: Syntax error. Missing " IF(ISBLANK(BillingState), "None", IF(CONTAINS("CA:WA:...
user avatar
  • 31
12 votes
1 answer
247 views

Why is CaseFeed.CreatedById Polymorphic?

A polymorphic lookup is, by definition, one where the SObjectType of the parent be multiple different values. That was the basis for how I compiled Polymorphic keys - definitive list? However, a ...
user avatar
  • 143k
4 votes
0 answers
462 views

Baffling compile 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 key ...
user avatar
2 votes
2 answers
4k 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,...
user avatar
  • 31
0 votes
1 answer
29 views

Trigger code error

I am really new to triggers and not sure how I fix this error, please help. Thank You, Lorr
user avatar
  • 1
-3 votes
2 answers
85 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 ...
user avatar
  • 39
-1 votes
2 answers
925 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<...
user avatar
  • 39
-1 votes
1 answer
29 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,...
user avatar
  • 39
0 votes
1 answer
3k 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. ...
user avatar
0 votes
1 answer
2k 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 = (...
user avatar
1 vote
2 answers
810 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"...
user avatar
  • 9,091
1 vote
1 answer
811 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 = ...
user avatar
0 votes
1 answer
1k 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;} ...
user avatar
0 votes
1 answer
45 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 ...
user avatar
3 votes
1 answer
59 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 ...
user avatar
  • 31
-1 votes
1 answer
501 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 ...
user avatar
2 votes
1 answer
3k 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){ ...
user avatar

1
2 3 4 5 6