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
2answers
23 views

Unknown property 'SetValue.Id'

While i'm displaying set data into vf page it's showing the error vf code :-- <apex:page controller="Soql_Ct"> <apex:form > <apex:pageBlock title="Soql_Example" > ...
2
votes
1answer
36 views

Apex Class setting Opportunity Close Date

I am trying to remove the section of the apex class that references the close date but I am getting an error that record creation failed when selecting my button. Do you have any suggestions? {public ...
0
votes
0answers
22 views

Structure of visualforce page using standard controller, extension and wrapper of data?

I am creating a component to add to a contact record that shows aggregated note data from two different sources. Page <apex:page id="AggergatedNotes" standardController="Contact" ...
0
votes
0answers
26 views

Javascript Error when trying to use apex:actionFunction on service console

I have a visualforce component I am working on that simply has a table of data that is shown on a page layout within the service console. When you click on a link in the table, it opens a subtab using ...
0
votes
1answer
30 views

List.add() repeats the same value “n” times controller

This code below in my controller gives the same task 'n' times in the list. Am I missing any pointer reference here ? try { listrecurringtaskWrapper= new List<Recurringwrappertask>(...
0
votes
1answer
90 views

How to display records based on picklist selection using visualforce

I have 3 values in my picklist Account, Contact,Leads. I need to display the duplicate records of selected objects, for example, I have selected Contact then it should display Contact duplicate ...
1
vote
1answer
28 views

iterating list values to update multiple fields

Though the below code is working fine, since its not the right practice to hardcode index numbers so is there any alternate approach for the below code. - thanks List<Contact> cntList = [...
2
votes
1answer
33 views

How to call Static Variable in non-static method?

In an apex controller constructor I have set a value in a static variable (say VerificationCode). In the VFP button click action, I am invoking the registerUser method (non-static method), in the same ...
0
votes
1answer
51 views

How to compare a duplicate list values and delete it

I have a use case where in 1 Order Contains multiple OrderItems, and these orderitems contains records. lets say there are 5 orderitems to 1 order, and among 5 orderitems 2 are duplicate and 3 are ...
0
votes
0answers
18 views

Lightning Container NPM - no controller and/or function found

I am working with the lightning-container npm package and have a call in a React app uploaded as a static resource. This simply onClick, calls the LCC.callApex method as below. LCC.callApex("...
-1
votes
1answer
58 views

I am getting Error at the time of saving the record using page reference to navigate to standard application, Please help

Controller - appNavigation : function(component, event, helper) { var action= component.get('c.getAllApps'); console.log(action); action.setCallback(this,function(response){ ...
0
votes
1answer
19 views

CommandButton action fails when selectList is populated

I have a visualforce page where I have a form with 4 separate selectLists with options populated based on different user groups. So far so good. This form also has a submit button which triggers a ...
-1
votes
1answer
24 views

Display Profile Photo of Partner Users in a VF page [closed]

I have a requirement to display FullphotoURL of Partner Users in a VF page which are of 700 (Pagination can be applied to display in multiple pages). It should be displayed with the name of the User ...
3
votes
1answer
39 views

salesforce Pre fill value in create page

Is it possible that pre fill value on the create page example: public PageReference Create() { Contact tmp = new Contact (); tmp.Name ='test123'; return new apexPages.StandardController(tmp)....
1
vote
1answer
26 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
19 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
27 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
27 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 ...
2
votes
3answers
158 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
27 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
20 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 ...
0
votes
1answer
219 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
24 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
49 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
56 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
36 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
61 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
36 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
45 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
13 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
26 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
30 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
54 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
37 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
43 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
11 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
43 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
13 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
43 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
107 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
19 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
190 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
39 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
38 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
210 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
57 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 ...