Questions tagged [apex-variable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
37 views

Variable does not exist - Batch Apex Query

I have a Batch Apex which is invoked from process builder. I can see Ids are coming into the variable (please see debug log) but same variable inside the query gives "Variable does not exist" error. I ...
0
votes
1answer
32 views

Can i create changing variable in apex class

Hello guys i wrote to update class for case object and this object have a many records thats why i cant execute Soql queries, I encountering error: "So many soql queries",i searched i found one way, i ...
1
vote
2answers
65 views

Variables in Interface in Salesforce

Can you declare variables in Interface in Apex (Salesforce). In Java, it allows you to declare and initialize variables with public static final keywords in Interface. Also in Apex, are all abstract ...
2
votes
1answer
39 views

Pass value from apex component to controller

I have a visualforce force component: <apex:component controller="NewITAssetController"> <apex:outputPanel> <label>Date field</label> ...
0
votes
1answer
46 views

Soql on Account returns empty Id

I have a controller where I get a token from a visualforce page with account as a standard controller and controller extension. In my unittest I insert the variables but the accid throws an exception ...
0
votes
0answers
68 views

getting Must trace apex_code at finest when checking the variable panel

I have already set the apex debug level at FINEST but still when I check the variable panel I still see the message must trace APEX_CODE at Finest can someone please suggest on the same? Below is the ...
3
votes
1answer
39 views

What is the difference between a variable and an automatic read-write property?

Accordingly to the Apex Developer Guide, An Apex property is similar to a variable; however, you can do additional things in your code to a property value before it is accessed or returned. ...
0
votes
0answers
20 views

Maintain the State of a Controller when Opening a Shared Controller VF page as a Console Tab

I am trying to pass all of the values from an object from one Visualforce page to another. objX is queried for two fields id and fieldOne and stored in a list on the controller: listObjX The object ...
0
votes
2answers
49 views

Removing record reference in class

Expansion to original question: Error: Future method cannot be called Need to remove record variable from reference. Can someone help me and explain the process? Error: Error: Compile Error: ...
2
votes
2answers
671 views

What is this technique called?

public static List<Holiday> holidays { get { if(holidays == null) holidays=[Select h.StartTimeInMinutes, h.Name, h.ActivityDate From Holiday h]; ...
0
votes
1answer
49 views

How to pass query variable from soql into loop

I am trying to bulkify a callout where I want to pass the recordtype in my loop but I get: Error: Variable does not exist: RecordType If I try public RecordType personAccountRecordType I get ...
0
votes
1answer
32 views

Add a starting value to an Apex:Variable in a Apex:repeat Table

I have created a simple table of data in a VF page, which uses Apex:Repeat to list records. There is a column that contains a cumulative amount, by way of apex:variable. The cumulative amount works ...
0
votes
1answer
76 views

How to make variable show the count of records from a dynamic soql query [duplicate]

I have a custom controller with a variable 'count.' I want this to update on the page every time the account list updates. Right now it's static. It just displays the original number of records in the ...
0
votes
1answer
970 views

Variable does not exist in test class

ProcessHandlerShowAccounts class works, but I am trying to get my test class up to par to validate my data. I am getting a variable does not exist, not sure why Did I initiate the class wrong? Also ...
0
votes
1answer
359 views

Variable does not exist within invocable method

I am trying to access the variables sent from the Process Builder within the apex class. It says the variable accountParamter does not exist, which confused me because I declare it in the parameters ...
10
votes
4answers
835 views

Is there any benefit, performance-wise, to declaring Apex variables as final?

In other languages (see, for instance, Swift), stating explicitly that a variable is final lets the compiler optimize the code accordingly. Is this the case with Apex?
1
vote
1answer
121 views

Dynamic Fields in for Loop

Is there a way to dynamically change the fields within a for loop? As an example, if I have for loop: for(Account a: myQueryResult){ if(a.parentId = fieldVariable){ Do something ...
0
votes
1answer
361 views

Issues updating a apex variable on visualforce page

I have an apex variable that is the summed value of record amounts in a pageBlockTable. The idea is when an amount value is changed, a javascript function is called to recalculate the amount for all ...
0
votes
3answers
100 views

Variable does not exist on trigger class

For the following class, I get the error 'variable does not exist: mq' on lines 25 - 27 Public with sharing class InspectionQuotasHandler{ public static void UpdateMonthlyQuotaOfInspection(List&...
3
votes
1answer
430 views

Flow and InvocableMethod Simple Question

How would I create an array of the values from the flow and pass them into the APEX @InvocableMethod? My method is taking in a list of Strings: @InvocableMethod public static List<String> ...
0
votes
1answer
211 views

Variable does not exist in global method - batch class

I have tried to put together a batch class to update parent Account records with credit scores.. I need to make 2 list variables public so I am able to access them in the finish global batch method, ...
2
votes
1answer
87 views

VF Component modifying an apex:variable outside of its scope

I just stumbled upon a weird behavior of Visualforce Components (or apex:variables). Please see the code below and then the end result: VF Page <apex:page> <apex:variable var="foo" ...
0
votes
1answer
335 views

Escaping variables in Email templates

I am trying to build the body of an email by using the fields of a given custom object(SObject). On this given SObject I am including some variables. One of those variables is the title of the Contact....
1
vote
2answers
4k views

Round off an apex variable upto two decimal places

I have apex variable in my visualforce page, which is calculated as below - <apex:variable var="cntFinal" value="{!IF(cntVar1==0,0,(cntVar2+cntVar3)*100/cntVar1)}"/> Now, I want to set this ...
2
votes
3answers
325 views

Accessing passed variable from Visualforce page OR pass Controller.addFields in TEST

I want to pass the pricebook2id from an opportunity to my apex class and then use this when querying. I can get it using the Controller.addFields when declaring the controller like this: public ...
0
votes
1answer
205 views

Accessing the deserialised object from a different class

I am using the following class to deserialise a JSON object: //Method to deserialize the response body public static responseResource deserialize(httpResponse res){ return (...
1
vote
1answer
91 views

Compile Error on Map: Variable WhoId Doesn't Exist

Got the compile error for the snippet of code below. Says variable record.whoId (bolded) doesn't exist. Tried adding more brackets to the if statement, capitalizing WhoId and didn't work. Here's the ...
0
votes
2answers
1k views

Get value from custom setting

I have a batch process that I want to be able to dynamically tweak the batch size without changing the code in sandbox and then deploying each time. I figure I can use a custom setting as I have been ...
1
vote
0answers
219 views

SOAP Call w/o WSDL body too large error

I am working on integrating an asmx webservice into salesforce. I was unable to parse the WSDL into apex, so have to build the calls manually. The call I built works and is received when literal ...
1
vote
2answers
228 views

New Line in Apex Variable

I am trying the following code: <apex:variable var="variable1" value="{!CASE(object.field, "val1", "line1 line2", "val2", "...
1
vote
1answer
462 views

Variable does not exist: insert record

I'm trying to insert a new record into an object where I pull information from OpportunityLineItem, Product, Opportunity, and Account. I did a query and get the results I want. Then I go to create a ...
2
votes
1answer
394 views

Pass a variable from Javascript to Apex Controller

I'm trying to pass a variable from a javascript inside a VF page to a varibale in the Apex Controller. The VF page code is: <apex:page controller="uploadDataTosObject" apiVersion="36.0"> [...
0
votes
0answers
571 views

Stop increment of apex variable

In my VF page I have: <apex:pageblockTable value="{!interview.Skill_review__r}" var="skillreview"> <apex:column headerValue="Rating"> <apex:...
1
vote
2answers
1k views

Trouble passing variable from Apex to VF Page

I'm trying to pass a simple string to a vf page, but can't seem to. What am I doing wrong? APEX public class ControllerJSGeo{ public String pId; public String testString {get;set;} ...
1
vote
1answer
367 views

Define apex:variable in apex:inputText

I'm trying to pass parameters while using immediate=true. (actionRegion is not an option) Since this won't work: <apex:inputText value="{!searchValue}" /> <apex:commandButton value="...