Questions tagged [global-variables]
The global-variables tag has no usage guidance.
81
questions
1
vote
1
answer
42
views
Global Variable not visible
I have an issue where only some of my global variables in my managed package are visible.
Ex: I can access bool1 and bool2 in developer console and in non managed classes but bool3 and bool4 give a ...
0
votes
0
answers
126
views
How to store large amount of data in a variable for a batch bypassing heap size exception
I am stuck with the following error:
'Batchable instance is too big: ProductDiscountsFormatterBatch'
I have a junction object called Account_Product_Discounts__c with the information of, for each ...
0
votes
1
answer
38
views
I want to add number 7 as setting so that we won't need to update it with code change. Can we add this in Global settings? If yes, how? pls check code
So I have a formula field to check number of due days and I am checking that in my apex controller in 'if condition', if it is less than 7 or not. However, I have a requirement to make changes so -- &...
2
votes
1
answer
256
views
If I use a { get; set; } on a field in a Global class, will that get/set be public or global?
If I have a class that is global and I use the getter setter implementation:
Integer myInt { get; private set; }
Will my variable myInt be a global or a public variable?
-1
votes
1
answer
2k
views
How to pass variable from helperclass to finish method in batchclass
I have a bachclass with a scope of some records. These records have a startdate and enddate field. With a helperclass I set the earliest startdate and the lates enddate of these records in 2 variables....
0
votes
1
answer
2k
views
Can I pass several variables (set and maps) to finish method of batch
I have a batch process which loops trough records to count different statuses per user. I store these in a map. When the Batch is done I want to update the results on an aggregated object.
How do I ...
1
vote
1
answer
39
views
Global access modifier used for cross-application access
Often when we read about global access modifiers we come across that it "should be used for any method that needs to be referenced outside of the application".
Now I understand that in case ...
0
votes
0
answers
567
views
Combine global variables and custom labels in email templates
I am trying to dynamically place {!$Network.NetworkUrlForUserEmails} in a custom label for an email template. I want to confirm if these two hypothetical solutions are possible:
1. Include global ...
0
votes
1
answer
895
views
How to use getInstance() with 2 parameters
I have a class with a method from which I want to make an instance but on saving the instance method I get the error:
Method does not exist or incorrect signature: void getInstance() from
the ...
1
vote
1
answer
1k
views
Delete/Update Global Value Set values using Tooling API
I'm trying to update or delete values in my Global Value Set.
I succeed insert new values with the code below:
but when I change SetMethod to DELETE I get Bad Request with status code 400
is there ...
1
vote
1
answer
640
views
How to filter in a batch query on dates
I have a soql query in a batch process where I want to filter on dates. I currently get the error: First error: unexpected token: Start_Date__c. How do I advoid this?
Apex
global Database....
0
votes
1
answer
3k
views
How could I get values from a global declared map, inside a @future method?
I'm facing an issue of accessing objects,
That is the first time I'm trying to use Global variables on APEX ;
I got a @future main method that calls two methods,
In the first method I would like to ...
2
votes
3
answers
9k
views
Make child rows selected on selecting parent row - lwc tree grid
Is it possible to implement the logic - when parent row is selected all its child rows are selected as well with lightning web component and tree grid?
HTML:
<lightning-tree-grid
key-...
0
votes
1
answer
913
views
Global Variables - VisualForce Page - BaseUrl [duplicate]
I have a simple Visualforce page with just an Iframe inside.
I want to send as parameter to this Iframe the Instance URL.
To do this I use Global Variables, it is working for other parameters like {!...
1
vote
1
answer
424
views
Change/remove global method signatures or variables
I want to remove an unused custom sobject in my managed package, but it's part of a global method signature. Is it possible to remove the global method from the managed package or change the method ...
2
votes
1
answer
127
views
Static resource not able to access global merged fields
{!$Component.idPageTestCase.idForm.idFocusedTab}
This works well when it is there in Javascript tag inside visualforce page, but fails when the Javascript is moved to a static resource and the static ...
0
votes
1
answer
300
views
How To Pass Lead Email Address to IFRAME?
How do I pass a lead email address to an IFRAME? I did the following steps:
Created a new test lead.
Went into gear icon > Setup > Custom Code > VisualForce Pages, and created a new VisualForce Page ...
0
votes
1
answer
430
views
Variables in Schedule class losing values
I have a schedule class that class a batch class passing the source and target to merge child records from source to target.
Below is the schedule class.
global class FIMCConsolidationSchedule ...
1
vote
1
answer
3k
views
How to use @invocableVariable in Callout
I want to use the processbuilder to do a callout. In this callout I want to add some variables from the current record but get variable does not exist see below:
global class or_service {
@...
7
votes
1
answer
9k
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 ...
1
vote
1
answer
1k
views
can i pass all lookuprows values to javascript?
currently i am using this ampscript for lookuprows:
%%[
var @rows, @row, @rowCount, @numRowsToReturn, @lookupValue, @i
set @lookupValue = AttributeValue("lookupField") /* value from attribute or DE ...
1
vote
1
answer
343
views
Salesforce Global Values organization-wide (sandbox vs. production)
Is it possible to add custom global values in Salesforce so that we can use that global value in any apex class or controller?
And this values will be Ids of custom objects, so they will be different ...
0
votes
1
answer
83
views
Custom Link to handle multiple events
We currently have a custom link on an Account page layout on Salesforce Classic. The link currently adds a Salesforce account to an external system. I would like for it to mark a checkbox on the ...
1
vote
1
answer
832
views
What is the window.userContext and where is this loaded from?
There are several JavaScript Global Variables offered by Salesforce.
I was trying to locate some documentation around window.userContext but could not find anywhere. We are trying to use the window....
0
votes
1
answer
751
views
How to get/set a global variable/setting during or after login in apex
My idea is to have identical code executing in all environments to solve the issue when refreshing or creating new sandboxes.
I want the code to determine where it is executing and based on the ...
0
votes
1
answer
692
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, ...
0
votes
1
answer
414
views
Accessing hierarchical custom setting via global variable
It is possible to read hierarchical custom setting via $Setup(= global variable); however, each profile/user needs to activate the security feature Customize Application.
Activating that security ...
0
votes
1
answer
1k
views
Test a parameter from anonymous window
I am debugging code where it gets parameters from an opportunity record page but it seems to return empty. How can I test this in an anonymous window: productFamily = ApexPages.currentPage()....
0
votes
1
answer
82
views
How can I reference an installed pkg VF page in an OnClick Javascript Detail Button
I need to update this hardcoded url before an instance refresh and I am having difficulties finding a solution.
The VF page is from a managed package that has the namespace of scl
I have tried to ...
0
votes
2
answers
486
views
Using Global variables inside of Custom Metadata with Visualforce page Modal
What are design options for the following requirements?
End user specifies the text of a Modal window to be something like:
Hello [User Full Name],
Because you chose [Case.FieldA] goto this <a ...
1
vote
1
answer
114
views
Binding Fields in List With $ObjectType global variable
Is it possible to bind Binding Fields in List With $ObjectType global variable.
I have a few fields of Contact object to be checked if createable.
Is it possible if i store all the field names in a ...
3
votes
3
answers
2k
views
How can I use a global variable within a javascript if statement?
This is the code I've been trying to use within my visualforce page. My idea is to detect which user is using the page, and then have the javascript do something depending on who it is. The code below ...
1
vote
0
answers
264
views
Package org adds namespace prefixes to $Setup and $Label references - sometimes
In order to establish separate developer orgs for package development, I'm removing namespace references from the code held by a package org. However after a Visualforce page is saved to the package ...
1
vote
0
answers
62
views
Global attributes on Visualforce tab (to Lightning Component)
I built a Lightning Component I am using on a record page by sending global attributes via the appBuilder:
<aura:attribute name="attr1" type="Integer" access="global" />
<aura:attribute name=...
1
vote
1
answer
357
views
How to retrieve access in Javascript using Global Variable?
I read here that we can access ObjectType from Global Variable.I want to check if the user able to edit Account using updateable .But how to write it?
I tried this
{!REQUIRESCRIPT("/soap/ajax/30.0/...
8
votes
1
answer
2k
views
Salesforce lightning: how to add a custom global value provider
This question has been raised before but I haven't seen a satisfactory answer to it.
Basically I want to make global variable (which is a chart object reference) available to all components (for ...
0
votes
2
answers
4k
views
Simple Custom Global Variable
I need to run a scheduled job every few hours to refresh my API token for a 3rd party source. I want to store that API token in a global variable so I can access it from my controller. (I'm building a ...
0
votes
1
answer
579
views
Two Visualforce Page Same Controller
I have an issue that I am using two VF page with common controller. One VF Page is normal and other is opened as a modal on the 1st Visualforce page.
I am adding some elements on 1st VF page in a list ...
0
votes
1
answer
394
views
Using the $Action Global Variable when the object type is ambiguous
When building links in Visualforce, I typically prefer using the $Action global variable and URLFOR(). e.g.:
<apex:outputLink value="{!URLFOR($Action.Account.View,Account.Id)}" >
As far as I ...
0
votes
1
answer
525
views
Global variable vs class variable [closed]
I have been using a global variable such as $UserInfo.getUiThemeDisplayed in a visualforce page several times for rendered conditions. In this case which is better, using a class variable or global ...
1
vote
1
answer
437
views
Changing global class member type
I have a global class member in a managed package that I am working on with type Id. Can this member be changed to a type String in a future release of the package?
4
votes
1
answer
62
views
Can global members be added/removed from Beta packages freely?
Global things can't be un-global-ed once they hit production.
However, I need to debug something in a sandbox and want to generate a temporary beta build with some methods made global. Can I switch ...
0
votes
1
answer
2k
views
Writing to global variable/state from apex?
I'm writing a bunch of Apex triggers that access an external web site. This site issues a token which is valid for a period of time, so I'd like to store it someone globally and reuse it, rather than ...
12
votes
2
answers
3k
views
Can variables with inline get/set not be @AuraEnabled?
I have an existing class that works with a REST API from a managed package. This class represents the payload that the REST API accepts in implementations, so it has a number of variables that use ...
2
votes
1
answer
355
views
Cannot Access Global Variables in Force.com Site
I'm trying to use the global variablee '{!$Organization.Id}' and '{!$Profile.Id}' in a visualforce page. When I access the page directly from apex/MyPageName the variables are picked up ok from the ...
5
votes
3
answers
9k
views
Evaluate Current User for Flow - 15 - 18 digit User ID
I need to evaluate the current user running a flow. Someone suggested I use the Global Variable {!User.Id}, but it's returning a 15 digit Id. I need to compare the current user with the Account owner. ...
2
votes
1
answer
851
views
Use Global Variable $Setup in Lookup Filter
Since global variables can not be used in Filter criteria, I created a formula field, to pass it through.
But referencing this formula (with global variable) in a Lookup Filter does not work
Custom ...
5
votes
2
answers
1k
views
How to use $A.set() or how to add a custom global value provider?
I am a little bit confused. Knowing that not all features which are available in a pure aura project are exposed to Lightning Components I thought it is mandatory to check against the Salesforce ...
1
vote
1
answer
162
views
Combine Multiple Boolean checks in VF Markup
I want something like the below in my test to see of a outputPanel should be rendered
<apex:outputpanel rendered="{!recordType == 'System Change Request' & $currentPage().getParameters().get('...
1
vote
1
answer
769
views
The installed managed class zqu.ProductSelectorController is not visible
I am getting this error trying to use a custom visual force page in place of a managed package visual force page. I made my custom controller global, thinking that it was mine that needed to be ...