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.

Filter by
Sorted by
Tagged with
2
votes
1answer
400 views

How to get the public key in form of JWS Key set

I have a JWT Class which generates JWT Token using Private key. Now, I need to expose an endpoint for exernal application to get the public key in the form of JWKS KeySet. Can anyone guide me how to ...
1
vote
1answer
272 views

Future class error - First error: Argument cannot be null

I have a requirement where I need to send JWT token as a part of my request body. I have created a JWT class and an Apex rest class to acheive the required scenario. Below are the classes Apex Rest ...
1
vote
1answer
812 views

Wrapper in return method for test class

I'm creating a visualforce page for a Dashboard component. In the controller I have a wrapper class and in one of the methods I return a map of a list of the wrapper records. Example trimmed down: ...
1
vote
0answers
8 views

action failed:c: newasset_component$controller$doLibloaded['lightningUtilsLib' is undefined]

I have a strange error when i try to search for client in the global search. error action failed:c: newasset_component$controller$doLibloaded['lightningUtilsLib' is undefined] Some help? Thank you
0
votes
1answer
33 views

Issues with insert/creating a record in custom object using custom controller

VF Page <apex:page standardController="Applications__c" lightningStylesheets="true"> <apex:sectionHeader title="Application For Employment"/> <apex:form > <apex:pageBlock >...
2
votes
1answer
49 views

Javascript Controller to Apex Controller naming syntax error

I am getting an odd bug where capitalizing the first letter of an Apex method that returns a map, causes an error within the javascript controller. Javascript: var action = component.get("c....
0
votes
1answer
390 views

How to get recordtypeid from generic object

I want to be able to pass an object, and recordtypelabel as string into a controller and get the recordtypeId. How do I achieve this. I currently get variable does not exist for the custom object. @...
-1
votes
1answer
72 views

Test for SOQL in Apex Controller

I'm not sure if I'm testing correctly. What check here should be done? Could you help with the test? public class Controller { public List<MyTool__c> tools {get;set;} public Controller(...
0
votes
0answers
2k views

How to fix callout error — You have uncommitted work pending. Please commit or rollback before calling out? [duplicate]

I'm doing an upload attachment to AWS, but I'm getting this error -- 'You have uncommitted work pending. Please commit or rollback before calling out' How do I fix this? @AuraEnabled public ...
0
votes
3answers
49 views

How can I get test coverage for a Visualforce controller?

with this test class I have a coverage of 0% someone has an idea why it does not work I can not recover the id of the product it seems that it is not inserted public with sharing class ...
0
votes
1answer
73 views

Can't update a field in a custom controller

I've been trying to get a selected value from a radio button (apex:selectradio, i'm styling it with the 5-stars like Uber) in a Visualforce Page and save it to a field called Quality_Content__c from a ...
0
votes
1answer
70 views

How to pass a variable from the controller into the extension

I have a variable (SelectedProfiles) that returns a list of profiles that are selected from a multi-select picklist on a VF page, and is used in the where clause in a SOQL query that returns the CRUD ...
1
vote
0answers
125 views

Full Handlebars Markup Language in Lightning email templates?

Is it possible to use full Handlebars Markup Language (like Handlebars helpers, #each, #lookup, and callbacks to controllers) in Lightning email templates? I want to create an email template for use ...
1
vote
2answers
29 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
527 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
427 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
397 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
156 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
1answer
29 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
43 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
91 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
83 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
125 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
144 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 ...
2
votes
2answers
4k 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, ...
1
vote
1answer
1k 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
2k 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
100 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
87 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
59 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
90 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
614 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 ...
4
votes
2answers
3k 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
145 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="...
1
vote
1answer
64 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 ...
1
vote
1answer
264 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
2k 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). ...
2
votes
1answer
2k 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
13 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
678 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
297 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
1k 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
23 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
92 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
1answer
1k 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
194 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
514 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
86 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 ...
1
vote
1answer
861 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
115 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 ...

1
3 4
5
6 7
27