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
1
vote
1answer
32 views

VF controller function referenced by apex:actionSupport not firing

I'm trying to call this function but the debug statement is not working. <apex:selectList value="{!year}" title="Yıl" id="yearFilter" multiSelect="false" size="1" > <apex:...
0
votes
1answer
25 views

User-Interface API for custom Edit Visualforce Page

Below is the sample code i have written working fine, However I am search for option using userinterface api in controller class to get layout assignment on the basis of recordtype and loggedin user ...
0
votes
1answer
225 views

Test class data created before 'runAs' user not visible

My test class sets up a Community User and some data prior to doing a runAs the new user. In the runAs section I call a controller which requires the use of the data I created earlier, but it doesn't ...
0
votes
0answers
29 views

Zero Coverage for controller class [duplicate]

I have a simple visualforce page that is meant to give a location for admins to disable a trigger and schedule a batch. I have not been able to get any test coverage when I run the test. I've ran the ...
3
votes
3answers
2k views

Difference between Transient and Static variable?

In SF docs, we will get an example of transient variable getting recreated each time the action is done via button. It will help to reduce view state. Although if I used static keyword the view state ...
0
votes
1answer
20 views

Custom Controller methods which are passed an object

I'm outputting a list of Opportunites and want to create a hash, or checksum for some of the data in the object. Is there a way to pass the current apex:repeat object back to the controller to get it ...
0
votes
1answer
29 views

Sending Bulk message error

I have been working on Messaging class where I have to fetch records and need to send indivisual customer mail Vf page as PDF with their individual records. When I get this records and put into the ...
0
votes
0answers
21 views

How to rerender an output panel when the data becomes available?

I have a VF pages that takes on parameters, and when a "Search" button is clicked, a call is made to an external source. The returned results are displayed on an output panel that rerenderes after the ...
1
vote
1answer
3k views

Apex - Check if user has permission to edit Field

Is there a way to check via Apex or Javascript (Lightning Component JS Controller) if current user has permission (profile or Permission set) to Edit fields on Account Object ? For example, i have a ...
0
votes
0answers
218 views

How to show ActionStatus spinner without using the reRender tag on button

I am using an SLDS VF page, where I display search parameters. When "Search" button is clicked, the parameters are picked up and a call is made to an external resource, and if there are any matches ...
0
votes
1answer
963 views

How to Add spinner to SLDS VF page when button is clicked

I must be missing something here because the spinner does not show up, but not sure where the problem is. What am I missing? <li class="slds-button-group-item"> <apex:commandButton ...
0
votes
0answers
387 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
1answer
950 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
62 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
49 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
21 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 ...
1
vote
0answers
107 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
123 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
149 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
49 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
93 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
1answer
149 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 ...
1
vote
0answers
22 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
108 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
343 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
30 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
1k 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
65 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

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
30 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
659 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
162 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
1answer
1k 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
317 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
679 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
75 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
2k 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....
1
vote
1answer
85 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
125 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
145 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 ...
2
votes
1answer
2k 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
383 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
166 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
1answer
203 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
231 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
194 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 { ...
3
votes
0answers
135 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 ...
0
votes
1answer
177 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
448 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
34 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 2 3
4
5
27