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
20 views

Lightning Component to check Account Object value, and send to dynamic URL based on value

I am hoping someone can help me out with my custom Lightning Component - as the support team have been unable to actually help with code, but have sent several articles that seem to contradict each ...
0
votes
0answers
19 views

How to make communities public which has no VF pages/custom code

I have a community where I want to display few Einstien Analytics dashboards which I want public to access without logging in. I found that we can make Community Public using vf pages in public access ...
0
votes
1answer
57 views

Wrapper Class Error on Account Hierarchy

I have created one VF page which is on Account object to show the Account Hierarchy at the parent level. Basically this VF page will show Contracts of all child Accounts on parent account. I have ...
0
votes
1answer
26 views

Update Status field when button is clicked in lightning component

I have a button on custom object which is when clicked should update the status of the record to "Awaiting Approval" Below is the lightning Component <aura:component implements="flexipage:...
0
votes
1answer
18 views

Visualforce page - multiple clicks variable not updated

I have a simple visualforce page and controller - clicking the button logs the value of boolean instance variable 'mybool' then flips the value. When I click the button rapidly the instance variable ...
0
votes
2answers
41 views

How to show the output using Lightning Component

Requirement: Show the Account Name, Phone and Industry as output whose Account ID will be given as an input. We have to do this using Lightning component. Below is my Lightning Component: <div&...
0
votes
1answer
17 views

Trouble with a test class

Its a simple enough Controller but for some reason I cannot figure out what the heck to write the test class. Controller: public with sharing class pairHouseholdController { public Id ...
0
votes
1answer
40 views

Calling Managed Package Method from custom VF page

I have installed Salesforce CPQ managed package in my org and there is object called 'Contract' which has Renew Contract button in it. I want to use that button in my custom Visualforce page so as to ...
1
vote
0answers
14 views

pageReference behaves differently in classic and lightning

I have a VF page with a button. When the button is clicked, I would like a new tab to be open for the defined URL. At the same time, I would like the original VF page to remain at its original state. ...
0
votes
1answer
162 views

Modal Pop up on standard Lightning record detail page

I have a requirement that when a standard account record is opened, a pop up should be displayed with few fields of account like phone, name, type with ok button. When ok button is clicked, the pop up ...
0
votes
0answers
34 views

Is it possible to make the name of an aura:attribute dynamic and pass it to controller?

Currently, I'm targeting the aura:attribute by its name but the problem I'm having is when I'm setting the body of v.reactApp in my controller is setting it for all of the components that are already ...
0
votes
1answer
64 views

Issue when pushing to body of aura:component it pushes to the body of all aura:components rendered in DOM

Situation: Up to a few days ago every time a user would open a new salesforce tab when opening support cases I was able to create a new aura:component and push a JS static resource to the body of the ...
0
votes
1answer
54 views

How to add checkboxes for each records showing Contracts of Account according to hierarchy on VF page?

Account is one object and Contract is another object. I want to show Contracts of all Child Accounts on Ultimate Parent Account. Below is the code for same. Controller public with sharing class ...
0
votes
0answers
24 views

Minimum and maximum response time for the server-side action in Lightning component

From the documentation, it is said that server-side actions are asynchronous in Lightning. So, how long will it take for the server-side method to respond back to callback function. If so, what ...
0
votes
1answer
47 views

Modify Date Range

How do I modify the code below to have the week range from Thursday 12 PM Central Time Zone to the following Thursday 12 PM, so setting the Start date of the week to be Thursday and end week to be ...
0
votes
1answer
12 views

How to pass no value into a VF custom search controller

I am sure this is a very basic question, but the solution I am thinking of does not seem to be efficient, so I was wandering if someone could point me in the right direction. I am building a custom VF ...
1
vote
1answer
30 views

Return page reference with if statements

I'm wondering how to call new pagereference with if conditional statements, here is my controller; public with sharing class TargetController{ //Set up all getter and setter method public ...
0
votes
0answers
34 views

Apex batch job failing with “First error: Read timed out”

I have a batch job that is failing with the following error First error: Read timed out In the debug log, I got the repsonse as FATAL_ERROR|System.CalloutException: Read timed out When I ...
0
votes
0answers
38 views

How to restrict sales-person to download the Quote Document?

I want to restrict the sales-person from downloading the Quote documents in Salesforce CPQ. After the sales-person clicks on [Generate Document] button from quote page,it redirects to Generate ...
0
votes
0answers
52 views

Attempt do de-reference null object

I'm in a little bit of struggle here. Have an error in this class. I tried to debug log this error but I don't understand why only one user is having this problem. For the rest of the users this error ...
-2
votes
1answer
46 views

Map is always getting null value when i access locMap

global with sharing class InventoryCountBatch implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext BC){ return Database....
0
votes
2answers
31 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
42 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
29 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
29 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
0answers
113 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
31 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
37 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
57 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
30 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
60 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
21 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
27 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
40 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
28 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
32 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
330 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
28 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 ...
1
vote
1answer
553 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
45 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
84 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
94 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
64 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
122 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
39 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, ...

1
2 3 4 5
25