The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0
votes
0answers
9 views

ApexPages.StandardSetController.getSelected() return different amount selected

We are using the ApexPages.StandardSetController to display a list of results in a visualforce page. But as soon as we select more than 20 records, the number of results returned by the method isn't ...
0
votes
0answers
29 views

Need to get Max values from a list

I have a custom apex page where the records will be displayed every month for a logged in user. They are as follows: Now, my requirement is to display only max records of an Account instead of all ...
0
votes
1answer
36 views

How to get ID from aggregateresult[] groupedresult

I have an aggreateresult[] soql as follows: AggregateResult[] groupedResults = [SELECT id, Account__c, Account__r.Account_ID__c, MAX(Account_c__C) FROM ...
1
vote
2answers
33 views

Help with SOQL grouping

I have a requirement where I need to display top records from an object instead of all that meets the criteria. Below is my SOQL SELECT CustomAccount__r.Name, CustomAccount__r.Country__c, Month__c, ...
0
votes
3answers
44 views

my if condition is not working..else condition is working fine…somebody please told me what is wrong

public class BookingCltr { @AuraEnabled public static void CreateRecord(String conObj, String bookObj){ contactObject con = (contactObject)JSON.deserialize(conObj, contactObject.class);...
0
votes
1answer
8 views

Feed Streaming API Details to Visualforce Controller

Our sales managers want to buy a product called Hoopla but we don't have the budget, so I've been asked to build something in-house. The product does quite a bit, but the pieces they're most excited ...
0
votes
0answers
15 views

Duplicate Rule Bypass with RecordEditForm in Lightning

I am struggling with figuring out how to pass dml.DuplicateRuleHeader.allowSave = true; in Apex on a Lightning RecordEditForm component. I am using RecordEditForm as a record creation form and ...
0
votes
0answers
25 views

How to query data from related objects without lookup (ProcessInstance and TargetObject) for use in a LWC?

I am hoping to build an LWC for displaying pending Approvals related to Opportunities, as well as a number of field values from the Opportunities themselves. Since the ProcessInstance and child ...
1
vote
1answer
37 views

HTML Email Templates delivered Incompletely in Lightning List Email

I have few html email templates which are used to send mass emails to Contact and Campaigns. They are working fine in Salesforce classic whereas in Lightning, they are delivered incompletely. We need ...
0
votes
1answer
35 views

Value of the Multiple child record of One Parent on the VF page:

I have completed around 100% of the requirement , only part i am struggling to show the correct value of the two boolean field against there Parent For ex : Parent A : Child 1: (Field -- ...
0
votes
1answer
37 views

Prevent user clicking outside Custom lightning component

I have a parent custom Lightning Component which includes a custom lookup component inside, for Account Edit/Create. I want when the user starts typing (and results start to appear in a drop-down list)...
0
votes
0answers
8 views

How to Show Specific Options for Lookup Field in Visualforce Page

Is there a way to specify what values are available for a lookup field that is on a custom visualforce page? The requirement is to only show certain values on a page that is creating a new object, so ...
0
votes
1answer
36 views

For loop to check if a list contains a string

I have a picklist on a visualforce page and I'm trying to filter by namespace prefix to display objects belonging to a package as well as the account and contact objects. I have the for loop below ...
0
votes
0answers
12 views

How to get email from Account for user while creating user in Salesforce

Below is the controller which will create a partner user in Salesforce. In this code, I'm getting email from auth provider data.email. But I need to get it from the user's related partner account. Can ...
1
vote
0answers
14 views

Initials Profile Picture

I am trying create a function to display the initials of the person (not the current user) if they don't have a profile picture. I have all the initials stored in a list in my page controller. Can ...
0
votes
1answer
37 views

URL No Longer Exists ParentId=ApexPages.currentPage().getParameters().get('ParentId');

I have a VF page that allows child records to be updated , this is working well.EXCEPT for the following page I am trying to use ParentId=ApexPages.currentPage().getParameters().get('ParentId'); and ...
0
votes
1answer
49 views

How to read/write data from lightning:buttonStateful in lightning component

I need functionality similar to the "follow" button in a lightning component. I'm using the stateful button as described in the lightning component guide: https://developer.salesforce.com/docs/...
0
votes
0answers
18 views

OnChange input picklist field page message is not showing

I am writing a VF page where my requirement is that I have a input picklist field. When I change the picklist value it is calling to controller method. And when in controller I have written a page ...
1
vote
1answer
51 views

Change the case status through Omni-Channel on accept event

I am using Omnichannel for acceptance of the case. The requirement is that when an Agent accepts a case, the case status should be updated to 'In Review'. I have created the trigger on the AgentWork ...
0
votes
1answer
38 views

Apex page failing DML transaction

Let's have a very simple apex page: <apex:page controller="EventInsert" > <apex:form> <p>Event insertion test</p> <p>{!processParams}</p> <apex:...
0
votes
0answers
25 views

How to display alert if a custom listview button (VF) doesn't get records

I'm trying to show an alert in a Visualforce (custom listview button) if the controller receives less than 1 or more than 99 id's. The VF get's the integer from the apex controller once a listview ...
0
votes
0answers
20 views

ApexPages.message not showing in first VF when redirect to another

I have two VF with the same controller, the second one I used it as a CSV file, I need that in the First VF a Apex.Message shows and then downloads the CSV file. Part of the Controller. ...
0
votes
0answers
26 views

Controller property set to null after actionPoller execution

I am assigning controller properties with some value in its constructor. I am using <apex:actionPoller /> on VF page and it is rerendering some part of visualforce page section. But it not ...
0
votes
1answer
63 views

How to get selected pick list values with Apex for Aura Component

I have established a custom field called "Products Used" on the account object with a variety of banking products to choose from. I am trying to program an Apex controller to query the selected ...
0
votes
1answer
36 views

Delete Row button from List of record not working in Visualforce page

I am writing a VF page where I have to show list records with Add/Delete button. when I click Delete (X) button it is deleting the record and removing that particular row. But if I am adding a row ...
0
votes
2answers
49 views

How to simulate visualforce page button in test class in order to deploy it?

Hi I have an Apex class which is called/invoked from a custom button called "desiredLocationsPage" , I have created the custom button in production like below; I have tested my test class in sandbox ...
0
votes
1answer
43 views

Lightning Component redirecting to record it is creating

I am trying to create a new record using a save button on a lightning:recordEditForm Im am fairly new to coding lightning components and have come to a bit of a standstill trying to get it to ...
3
votes
1answer
60 views

Redirect to VF Page not firing

Good day, I posted this over on the Salesforce Dev community forums but have gotten no responses. I'm hoping someone here might be able to assist. We have a call center application integrated with ...
0
votes
1answer
27 views

How to assign field values to a constructor in Apex Test Class?

I am trying to test my custom controller's saveNewContact() method. I am trying to set the fields on the page, or in the constructor contact, and attempt to save the record. Unfortunately, when I run ...
0
votes
2answers
33 views

<apex:inputSecret> auto populate is not working?

I want to display password value as secret and it need to be auto populate from salesforce without passing manually. I can able to display username but password field display empty. Anyone help ...
0
votes
2answers
98 views

userinfo.getuserid() returning null in test class

I have a test class which inserts partner user for testing. So, when I pass userinfor.getuserID(), it is returning null due to which my test class is failing with error "System....
0
votes
0answers
18 views

update partner account status field when partner user profile is updated

I have a partner user who has active partner account. If there is any issue with the payment, the users profile will be updated to "restricted profile". I have a requirement where, if a partner user'...
1
vote
1answer
42 views

4 Level Picklist Dependency

I'm trying to set up 4 picklist that are dependent on each other. The idea is this: There are 4 different picklist. Pick1, Pick2, Pick3, Pick4 Pick2 is dependent on Pick1. Pick3 isn't necessarily ...
0
votes
1answer
20 views

Save vf page as attachment in custom object

I have a dynamic virtual page that I create, and I would like to know if it was possible to save it as html (not pdf as I need to do some modification later on) inside my related files for a custom ...
0
votes
1answer
35 views

Writing test class for wrapper class to simulate the business process

I am trying to write a test class for a Wrapper class. The wrapper class pulls one objects to make it as a checkbox list. Could anyone help me to adjust the code I wrote below? I have written test ...
0
votes
0answers
24 views

Field Sets displayed by VF Components in VF Page: How can changes to the fields be saved from the page?

I have a Lightning component for saving an application. So far the first tab embeds a VF page. That page in turn includes a certain VF component twice. Finally, the component dynamically pulls in a ...
2
votes
1answer
168 views

ForEach “=>” Javascript lightning

I want to add an if condition before I can fill the map "mapDataCible". Is that possible? inp.forEach(input => mapDataCible[input.get('v.name')] = input.get('v.value'));
0
votes
1answer
48 views

issue with userdata in test class for auto registration handler class

I have a test class which is as below @isTest private class KC_Reg_Handler_Test { static testMethod void testCreateAndUpdateUser() { KC_RegHandler handler = new KC_RegHandler (); ...
0
votes
2answers
37 views

Visualforce page to compare two old record with newly cloned record and highlight changed values

I need to create a visual force page to compare an old record with a newly cloned record. For example: Existing Fields. Account (Old Record) Account (new Record) id ...
0
votes
0answers
21 views

Perform insert operation from selected checkbox to another object

Hi I hava visualforge and the controller to show list from another object as checkbox, and its working as expected, but I get stuck on the following; Perform insert operation, so from the selected ...
0
votes
1answer
32 views

Pass selected checkboxes to controller and perform insert operation

I have a Visualforce page with a page block section which contains multiple rows from different object (Result from query in controller from custom object called "Location__c"). I need to pass the id'...
0
votes
1answer
36 views

Available Lightning Controller Data Types

Where can I find a list of the acceptable datatypes for the lightning controller component.set() for list values? I can see that type: 'text' and type: 'date' and type: 'boolean' work but integer and ...
-4
votes
2answers
55 views

Filter Id value is not valid for the Object standard controller

Now it works :) Thank you guys! public class VFController { public VFController(ApexPages.StandardSetController setCon){} public ApexPages.StandardSetController setCon { get { ...
0
votes
0answers
15 views

How to copy js object from one variable to another

I have a problem in javascript controller while assigning response. I have response "response.getReturnValue()" from setCallback function which is a list of records. I want to assign this to 2 ...
3
votes
0answers
38 views

Case standard list controller won't show any records on visualforce page

I am new to Visualforce, and for the life of me I can't get a case standard list controller to show cases. It works for Accounts and Contacts, just not cases. Here is the code: <apex:page ...
-1
votes
1answer
25 views

Need help in writing Test Class for Rest API Class [duplicate]

I have a REST API class which updates the user status in external system when the user status is changed in Salesforce. Below is the code public class AccUpdateController { @future(callout=true) ...
0
votes
1answer
32 views

how to navigate to object detail page from lightning:card title

I have a list of projects displayed using lightning:card. I would like the user to click on the title and then navigate to the record detail page. I referred to some posts online but couldn't make it ...
0
votes
0answers
22 views

Visualforce Controllers: pass parameters from Custom Controller to Standard Controller

Could anyone provide me with guidance on how I can pass field parameters from Custom Controller to Standard Controller without the use of URL? Custom Controller - handles input parameters and ...
1
vote
1answer
52 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
34 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 ...