Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [controller]

A controller is one piece in the Model-View-Controller (MVC) architecture of Visualforce. A controller can be a standard or custom controller and extensions to controllers can written.

1
vote
2answers
21 views

Why can't I apply replaceAll in my controller function?

I have the following component class, whose function is solely to modify a string for an email template. It works fine, inserting the concatenated string into the email. public class ...
0
votes
1answer
16 views

Google reCAPTCHA on Visualforce - server side verification

We have the Google reCAPTCHA all set up and working (in other uses in our org), but I'm having trouble getting it to work on my VF page. Clicking the submit button fires the recaptcha and I get a ...
0
votes
1answer
34 views

with sharing without sharing vs extension?

While going through manuals, it was mentioned Many times that apex classes will not consider security of logged in user but it will run in system mode and we should add custom controller extension to ...
0
votes
1answer
32 views

ignore empty values (or null) while passing JSON request to third party

I am passing request in JSON format to third party system but they want only to pass field which is not null else skip that field. I am trying to build logic to skip Null/Blank. Can someone please ...
0
votes
1answer
31 views

Test pagereference with selection of multiple Ids

I have a visualforce page where I select multiple ids. Based on my selection I start a flow. I dont know how to simulate the selection in my testclass. Visualforce <apex:page standardController="...
0
votes
0answers
21 views

Override Salesforce Approval Steps via Apex [on hold]

is there any way to override approval steps, for example, if an Admin approved step 1, then automatically the rest of the steps gets approve. Thank you in advance.
0
votes
1answer
25 views

String variable takes null value randomly after the first execution

In the first execution checkNumber takes the value from visualforce page properly.But after that sometimes checkNumber takes null value and shows the 'Please enter at least one search criteria' error ...
0
votes
1answer
13 views

VFP List Button Object Fields

Currently, converting a Javascript List Button to a List Button that uses a VisualForce Page. The button is on a related list on the Opportunity layout. Is it possible to grab Opportunity fields if ...
0
votes
1answer
32 views

Getting null in control from input field

I'm stack. I Have a simple controller and visualforce page. Controller: public class NewTaskSchedulerController { public Event Event {get; set;} public NewTaskSchedulerController(){ ...
0
votes
1answer
24 views

campinglistformcontroller.js can't insert form in database trailhead

I'm stuck at the last component Aura challenge, I managed the challenge but when I try to insert a form in the database it makes me mistakes. I tested with two submitform function ...
0
votes
1answer
31 views

Updating an array in controller to store user input from Visualforce page

I need to store input from user in controller so it can be used for calculations. To do this I am using an array, to get input in the controller. But getting issue: Subscript is invalid because list ...
0
votes
1answer
58 views

I have added a vf page(displays an error message) in pagelayout. I don't want it to be displayed when the case has attachment

I have a vf page that displays an error message. On Case object when I edit a case, and save it with an attachment, I don't want it to display that vf page. VF Page Code: <apex:page ...
0
votes
2answers
36 views

Lightning Controller window.open();

When I use window.open(); in my lightning controller, it opens the URL but at the end of the salesforce's url. It does open in a new tab which is what I want but the url is confusing me. For example, ...
0
votes
1answer
65 views

lightning:inputField is not rendering, saying the request is missing the field data when it is not

I am trying to display a list of date ranges based on an objects start and end dates using a lightning component. When I open it in a visualforce page as part of a set of nested components, it will ...
0
votes
2answers
42 views

Getting lightning:select picklist value in controller

hey i am trying to get a picklist value and want to multiply it with an integer number in lightning controller.I tried this code. Controller ({ calculateAmount : function(component, event, ...
1
vote
1answer
41 views

Onclick not working in visual force page if the case subject field having single quotes

We have developed an custom email section to have the emails in sequential order when a case is cloned (as this functionality is not there with standard emails section). Now we are facing a strange ...
0
votes
0answers
23 views

send mass emails from Salesforce using personal emails

We have users who will trigger mass emails to generated leads, child users as a part of their campaign. Till date, it is done using google and we are planning to remove gsuite from our system. When we ...
0
votes
1answer
57 views

Issue with the Trigger

I have a trigger which embeds the account's field value to the child contact field. I have a field named account code on account and when ever a new contact is created under this account, account code ...
0
votes
1answer
46 views

Issue with REST API in Production

We have a mobile app(Not Salesforce1) where the data is pulled from Salesforce using REST API. The basic functionality of the app is to return GranChild records when any Search Term is entered in ...
1
vote
1answer
55 views

How to generate pptx files with the VisualForce page and Apex Controller

Unable to open the generated file in OpenOffice unfortunately. My requirement is to generate a ppt file using dynamic data from Salesforce. Here is my snippet of Visualforce Page. <apex:page ...
2
votes
1answer
82 views

Value provided is invalid for action parameter [String param] of type 'String'

So my component has an attribute defined like this: <aura:attribute name="accountId" type="String" default="" /> that holds the value of a lookup lightning:inputField. I am setting the ...
0
votes
0answers
30 views

Any alternatives to using Iframe or methods to get my current one functioning?

This is the Visualforce page that I have being displayed. <apex:page lightningStylesheets="false" showHeader="false" standardController="account"> <apex:form > <apex:detail id="...
0
votes
0answers
21 views

Call Apex Controller method from button in Visualforce component table row

I have a Visualforce page which has a few Visuaforce Components to display sections of data, one of which contains a table with an "apex:repeat> for each row. Each of these rows has a button, which, ...
1
vote
1answer
16 views

Having issue with apex:inputfile and apex:repeat. Input being cleared when adding new set

I have created a apex:repeat section with several questions, including a apex:inputfile. Every time I add a new one, the file gets cleared but the other fields are fine. I checked my controller to ...
0
votes
0answers
19 views

Passing Javascript Array to Apex Controller always results in null values [duplicate]

I have a Visualforce page where I want to pass a javascript array in Visualforce to my Apex Controller. However the values are always null in my List in Apex. I have a commandButton that fires ...
1
vote
1answer
30 views

How can I get the name of the current app to the apex controller?

I need to get the name of the current app in the controller. So far I'm trying: public static String getAppName() { UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo ...
2
votes
2answers
220 views

jsPDF in Lightning component: get blob in Apex controller

I'm trying to use the library jsPDF on a lightning component. The lighting component handles the creation, and needs to pass it to my apex controller (in order to save the file in Salesforce). ...
1
vote
1answer
85 views

How do I populate a Lightning:combobox with content from a map?

I've generated a map in my apex controller which I would like to use to populate a combobox. Simplified code below: Component: <aura:component controller="myController" implements="force:...
0
votes
1answer
12 views

How to post a list of all open positions in a visualforce page without using a Custom Controller?

We want to post all open positions (custom object) to a Visualforce page. I want to keep all the standard functionality of the standard controller, but only show Positions with Status = "Open". ...
0
votes
0answers
45 views

I am trying to resize my duallist box with help of size option in lightning and it is not working

The size is not resizing the width of the list. Not working as given in the specification. https://developer.salesforce.com/docs/component-library/bundle/lightning:dualListbox/example
-1
votes
2answers
60 views

AES128: Apex Encryption to Java Decryption Checksum Generation

I am trying to integrate payment gateway into salesforce site, i have used the AES128 Encryption and same is use for decryption but while decryption i have used java code where i got the decrypt value ...
1
vote
3answers
94 views

How can I get this button to pass data to controller?

UPDATE I have the following function: <apex:actionFunction action="{!selectRec}" name="recordSelectFunction"> <apex:param name="selectedID" assignto="{!selectedRec}" ...
0
votes
0answers
20 views

how to use .getvalues with map and display the picklist value from custom setting on VF page thoghing null pointer exception [duplicate]

have a custom setting called product and under that i created two fields called and other is string field BD__c. i want to display picklist value based on string matching record. my custom setting ...
0
votes
1answer
35 views

checkbox won't update auraEnabled

I'm trying to update a checkbox field through lightning component and AuraEnabled method but, When attempting to update checkbox field I get error 'invalid field for insert update bad field names on ...
0
votes
0answers
28 views

How do I able to set login landing page according to user's profile

In order to implement my question, I tried overriding SiteLoginController like as below. global PageReference login() { User getProfile = [SELECT ProfileId FROM User WHERE Username=:username]; ...
0
votes
1answer
108 views

<aura:iteration> and input or <lightning:checkboxGroup>

I have a custom object Topics__c that I want list out like so: The text is the topic name which is a String data type. So I have to add in a checkbox along side the Name field. I have been doing some ...
0
votes
2answers
32 views

Passing argument to onclick event

I am dynamically creating HTML <div> and I need to handle the onclick event : when the user clicks on it, I want to call a controller function and this function requires an argument. How do I ...
0
votes
1answer
47 views

Dynamic DOM : firing event on click

I am dynamically creating some DOM elements inside my component's controller and adding them to the page. I need to set the onclick event on these elements to call another controller function that ...
0
votes
2answers
47 views

custom setting not displying correct picklist values based on the condtion

i have a custom setting called product and under that i created two fields called and other is string field BD__c. i want to display picklist value based on string matching record. my custom setting ...
0
votes
0answers
20 views

Unable to get record Id in the custom detail page after clicking save button using lightning

I have a custom new page for contact object..After clicking the save button,it should redirect to custom detail page.It was redirecting,but the record details where not displaying. custom new page (...
0
votes
0answers
26 views

how to display picklist values which is stored in custom settings values based on the condition [duplicate]

` public List getTR_ProductList() { system.debug('******Start of getTR_ProductList'); List options = new List(); options.add(new SelectOption('','--Select--')); Map Prod = ...
0
votes
0answers
25 views

Custom detail page should open when I click submit button in my custom contact page in lightning

I have a lightning component for detail page..When I click Create Contact button,a popup page will be opened.After filling the fields the page should navigate to custom detail page InputPopuppage:: ...
0
votes
0answers
17 views

Mailing Address Suggestions not showing in Lightning Component

I have a lightning component which is used in the community. When I have added mailing address field in the code, I can able to see the field but suggestions are not coming as we see in lightning ...
0
votes
1answer
54 views

Change field value in lightning component

I'm trying to change the value of the field Instagram_followers__c of my Influencer__c object in my lighthning component. It's a really simple component: a refresh button wich check the number of ...
0
votes
3answers
24 views

Data is not displaying on VF page but coming in Debug logs

Starting date of current week is not displaying on VF page (blank data), but coming in debug logs. Controller Code: public with sharing class Dummy { public date weekStart {get;set;} public void ...
0
votes
1answer
47 views

unlock record submitted for Approval

When a record is submitted for approval, it is locked by default. But as per the recent change by Salesforce, it can be unlocked using Apex class. I have this below Apex class which unlocks the ...
2
votes
1answer
134 views

Error in a formula field

I have a requirement where I need to populate records where a criteria is true. The criteria is the users must have joined in between Jul,2018 to May,2019. I thought I can achieve this using a ...
0
votes
1answer
44 views

Update related objects from list of fields returned from lightning component

I'm getting a List of javascript object from lightning component, that contains updated values and Id of a customObject in form: [{"contact__r.name":"Name","Id":"a3Rn0000000D2wcEAC", 'field1__c':'...
0
votes
0answers
36 views

Einstien Analytics Dashboard error: Aggregate query must have measures

I have a requirement where the old dashboards(created earlier to 2017) should be converted to new dashboards. Now when I click on "New Dashboard Designer" from old dashboard edit page, I will get a ...
1
vote
1answer
126 views

How to set Date field to not exceed today's date in lightning component

I have a requirement where I need Birthdate field on contact to validate so that it does not exceeds today's date. Below is the code: <lightning:input value="{!v.objContact.Birthdate}" label="...