As of May 31, 2023, we have updated our Code of Conduct.

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
1 answer
32 views

Apex Trigger - Compile error

I would like compile my apex triggers, but I receveive the following errors. Same message when i would like deploy apex on my production... :[ (i'm administrator, not dev). Could you help me please ? ...
Mat Skz's user avatar
1 vote
1 answer
29 views

Issues with Json2Apex

I've generated JSON2APEX class for complicated JSON, but when I created an instance of this class I can't deploy class where this instance is created, compilator doesn't see inner classes and throws &...
RandomNickname23's user avatar
0 votes
1 answer
143 views

Could not build module 'SFMCSDK' & module 'MarketingCloudSDK'

it's Ian, an iOS dev. My client wants to migrate the push notifications campaigns management of their iOS and Android apps to Salesforce. I'm facing compile issues after adding the marketing libraries ...
Ian Magarzo's user avatar
0 votes
1 answer
98 views

Error: Compiled formula is too big to execute (21,063 characters). Maximum size is 15,000 characters

I am trying to save the following formula field but it is giving me error. TEXT( MOD( FLOOR( TT_Calculate_Time_Elapsed__c), 24) ) & " Hours: " & TEXT( ROUND( MOD(...
Marjan's user avatar
  • 15
0 votes
1 answer
70 views

IF statement for Distance - Flow

I am trying to create a screen flow without using a loop to display "Nearby Accounts" (within 10 miles). However I am getting an error as seen in the below screenshot. I am fairly new to ...
Timmy's user avatar
  • 11
1 vote
1 answer
190 views

System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

I am a newbie to Apex programming in Salesforce so I have been basing my code off of the example code found here: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/...
CDutko's user avatar
  • 17
0 votes
1 answer
59 views

Invalid constructor syntax, name=value pairs can only be used for SObjects: Calendarview

I am attempting to create a CalendarView object for my users. I am basing it off of the example code found here: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/...
CDutko's user avatar
  • 17
0 votes
1 answer
36 views

Example Code from CalendarView Object Doesn't Compile?

I am attempting to create a calendar view object for my users. It is my first forray into Apex programming, so I have been referencing the example code in the developer docs. I ran into an issue with ...
CDutko's user avatar
  • 17
1 vote
1 answer
65 views

Compile all Flows?

Is there a simple mechanism to "compile all Flows" (e.g. in the way there is for Apex classes and triggers)? If not, what's the next fastest way to verify that dependencies aren't broken ...
Brent Bowers's user avatar
  • 2,994
4 votes
1 answer
756 views

Illegal assignment from List<Location> to List<System.Location>

Here's the SOQL I'm trying to run in my anonymous window, against the standard object: List<Location> locs = [SELECT Id, Name FROM Location LIMIT 2]; for(Location l : locs) { System.debug(l....
bkwdesign's user avatar
  • 541
1 vote
1 answer
101 views

HttpPut methods do not support parameter type of [user defined type]

I'm at a loss. This class already compiled, was deployed, and has been working fine in production for over a year. Upon updating it, I'm now getting: HttpPut methods do not support parameter type of ...
Mike's user avatar
  • 1,159
0 votes
1 answer
31 views

Can't seem to execute code against an unmanaged package

I'm relatively new to using unmanaged packages and have run into a (likely) simple issue. I'm currently attempting to execute some anonymous code against a package that I installed today, however I am ...
Rockdocta's user avatar
  • 154
-2 votes
1 answer
116 views

Error: incorrect signature: void get(Id) from the type String and Missing retrn statement reqired return type [closed]

@AuraEnabled public static ResponseWrapper dupNameCheck(Persons__c record, string srId, string pageId) { list < string > id = new list < string > (); list < Persons__c > ...
CHINNA's user avatar
  • 9
0 votes
1 answer
39 views

Test class compilation error Claim and ClaimParticipant

I am creating test class involving Claim and ClaimParticipant standard objects. While inserting these records, I am getting errors like Variable does not exist: Name and DML requires SObject or ...
Jigar Trivedi's user avatar
0 votes
1 answer
45 views

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

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 ...
BFP2044's user avatar
  • 11
-1 votes
1 answer
859 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} == {!...
user115088's user avatar
-1 votes
1 answer
219 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. ...
Henrietta Martingale's user avatar
1 vote
0 answers
147 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 ...
Diviya John's user avatar
3 votes
1 answer
143 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 ...
Carlos's user avatar
  • 115
1 vote
1 answer
129 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/...
Pete's user avatar
  • 61
1 vote
0 answers
140 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 ...
Rafał Fornalczyk's user avatar
-3 votes
1 answer
441 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 ...
Virat's user avatar
  • 11
3 votes
1 answer
95 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....
JoeDell's user avatar
  • 31
-3 votes
2 answers
546 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 ...
salesforce learner's user avatar
-2 votes
1 answer
1k 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,...
Zoom_v's user avatar
  • 3,824
0 votes
1 answer
750 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
1 vote
1 answer
89 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 ...
M Dhanapal's user avatar
1 vote
1 answer
766 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 ...
Aaron Kelver's user avatar
1 vote
1 answer
608 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....
Adam Carr's user avatar
5 votes
1 answer
76 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 ...
Mohamed Houssein Douici's user avatar
1 vote
1 answer
1k 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 : ...
Aavo Reinvald's user avatar
0 votes
1 answer
751 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....
Sagnik's user avatar
  • 555
0 votes
2 answers
3k 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 ...
skycafe's user avatar
  • 322
7 votes
1 answer
820 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 ...
DavidSchach's user avatar
  • 5,755
1 vote
2 answers
69 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 ...
Alexis Frisch's user avatar
0 votes
1 answer
190 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="...
Lawrence Liu's user avatar
4 votes
2 answers
4k 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:...
sskular's user avatar
  • 553
0 votes
2 answers
388 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<...
A_Gordoa's user avatar
-1 votes
1 answer
183 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....
sfdcDevloper's user avatar
0 votes
1 answer
472 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) ...
SFDC_Beginner's user avatar
1 vote
1 answer
868 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 ...
Anonymous123's user avatar
0 votes
1 answer
23 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 = '...
Sharky's user avatar
  • 35
1 vote
1 answer
73 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 ...
Martin Van Dyke's user avatar
1 vote
1 answer
3k 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',...
Chuck's user avatar
  • 11
0 votes
1 answer
86 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:...
Xperez's user avatar
  • 31
12 votes
1 answer
319 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 ...
Adrian Larson's user avatar
  • 148k
4 votes
0 answers
479 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 ...
Brent Bowers's user avatar
  • 2,994
2 votes
2 answers
7k 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,...
Tim's user avatar
  • 31
0 votes
1 answer
51 views

Trigger code error

I am really new to triggers and not sure how I fix this error, please help. Thank You, Lorr
Lorr's user avatar
  • 1
-3 votes
2 answers
88 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 ...
Timothy's user avatar
  • 39

1
2 3 4 5 6