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

Apex Tabs in Visualforce must load data only when clicked

I'm trying to design a VFP with TWO apex tabs with each tab having a table with list of records within along with some custom "search" logic. Tab 1 will load the data by default on initial page load ...
0
votes
0answers
14 views

How to save multiselect record in lookup field using LC? [closed]

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" controller="SaveFormVisitReport" > <aura:attribute name="recordId" type="String" /> <aura:attribute name="...
-1
votes
1answer
32 views

CSV parser to insert records into Custom Object

I have a requirement to insert records into custom object called Custom_Business__c using a csv file which is stored as a static resource. Below is the code I've achieved so far public class ...
0
votes
1answer
33 views

How to fetch Custom Metadata Type record in apex and compare it with a string

I have a string which is holding email ids of users from my org. Now I have few custom metadata type records which are holding email IDs of users who are inactive. Now I need to compare the string ...
0
votes
1answer
18 views

Visualforce controller to verify when batch job finishes and redirect to a list view

Good afternoon, first of all thank you for your help. I have a button on a Listview placed on a custom object that calls a visualforce page that starts a batch job, and what I want to do is to verify ...
0
votes
0answers
25 views

Prepopulate a Field via Button override of Clone button

I need to prepopulate the Cloned_From__c field on the case when a user clicks the standard clone button, the field should be the case that is being cloned. How do I prefill this field out before I ...
1
vote
1answer
28 views

Create multiple delete functionality for all the attachments related to a particular case

I have created a button on case detail page called "delete attachments" once pressing that, the page directs to below VF page where all related attachments to that particular case are displayed with ...
0
votes
0answers
21 views

currentid controller test case [duplicate]

Good day, Inherited this code. Can someone please assist me with a test case. I'm really not sure where to start: public class currentIdController{ public String PrintNotes { get; set; } ...
0
votes
1answer
41 views

Passing value from helper to class problem

Hope you can help me with my problem in regards of getting data according to category. Please see attached picture. I wanted to LOAD THE PRODUCTS according to ACCOUNT chosen on the ACCOUNT LOOK UP. ...
1
vote
1answer
20 views

component.set does not pass value from helper to controller via component

I try to set a value in my lightning component via the helper function, but it does not set the value in the component, and I get the wrong value when I try to do component.get in the controller. Here ...
0
votes
2answers
23 views

How can I make field mandatory inside datatable based on checkbox input

I need to make amount and mode field mandatory if corresponding checkboxes are checked. <Body class="slds-scope" style="width: min-content"> <apex:form id="disp"> ...
1
vote
3answers
105 views

Divide a string using Apex Trigger

I have a trigger which inserts merged record under a custom object called Account_merged__c. The trigger is as follows: trigger AccountMergeTrigger on Account (after delete) { List<...
0
votes
2answers
46 views

Autorefresh or reload of the Account page

I have 1 visualforce page, which opens up on clicking a button on Account Detail page. I am filling up few field information of Account in the visualforce page and want to get those updated in ...
0
votes
2answers
27 views

Getting Variable does not exist erro when trying to use a picklist value in method

I'm trying to pass a picklist value to a method if statement to change up the query based on what is selected form a picklist. When I try to use the if statement below I get a variable does not exist. ...
0
votes
1answer
11 views

Compile error in Controller

Error: Compile Error: Expecting "]" but was "AND" at line 30 column 133 accounts = [SELECT id FROM account WHERE id=: acc.id LIMIT 1]; tot=totalRecs = [select count() from Asset WHERE Status = '...
0
votes
1answer
26 views

Update Two Related Objects Through One VF Page

Very new to VF and controllers. Any help in the right direction is appreciated! Business Use Case: Operations team reviews a form verifying Account information against information provided on a ...
0
votes
1answer
11 views

Does selectList retain value after user changes it from one value to other without saving

I have a VF page where I have created picklist using SelectList and SelectOption. I have written certain conditions depending on which it populates a value in it. Now if any user changes it, will the ...
0
votes
1answer
43 views

how to include weekends and holidays using apex class

I have requirement, where i need to check the day is workingday or holiday for that i got one class but problem here is that, i have written trigger handler from handler class how can i pass date and ...
0
votes
1answer
15 views

How do I dynamically generate sections in visualforce page?

The objective is to have numberOfSections variable in the controller and then dynamically generate these sections on the vf page with the same format. How can this be achieved?
0
votes
1answer
31 views

System.LimitException: Too many SOQL queries: 101 won't be resolved

I'm trying to solve this error, but everything that I have been trying hasn't resolved it. No problems appear when I save the file, but when I preview the visual force page, the "Too many SOQL queries"...
1
vote
1answer
32 views

Compile Error: The method System.PageReference resetFilter() is referenced by Visualforce Page () in salesforce.com. Remove the usage & try again

I am trying to compile an Apex Class that works with a Visualforce page and upon attempting to save, keep receiving the error: Error: Compile Error: The method System.PageReference resetFilter() is ...
0
votes
1answer
35 views

I want to add value in list [closed]

here is a error for(Opportunity opp : Trigger.new){ if(opp.AccountId != null){ //Variable does not exist: AccountId opptyIdToAccountId.add(opp.AccountId ); //Variable does not ...
2
votes
1answer
33 views

SOQL query logic for date condition in Apex controller

On a visual-force page of a workorder record, I've to display list of workorders created for the same location where the createddate is within the last 30 days of the creationdate of the current ...
0
votes
0answers
24 views

Community Landing Page Controller

I have a Community with 3 home pages created using community builder. My requirement is that depending on a field on the User record, the user who has logged in should be redirected to different home ...
0
votes
1answer
17 views

Save button (associated to standard controller method) not working on visualforce page (standard controller + extension)

I'm creating a VF page with a list of all contacts on the top and a form to insert a new one on the bottom but the last feature doesn't work. This is the code of the VF page: <apex:page ...
1
vote
1answer
68 views

Toast is not firing from the lightning component

I am trying to show the toast on the screen after the field is updated using the lightning component the Controller looks like below Controller ({ recordLoaded: function(component, event, helper)...
0
votes
1answer
20 views

How to calculate the following exponential logic in the trigger? [closed]

How to calculate exponential in trigger?
0
votes
0answers
18 views

Lightning component to update a field on the record

I am trying to replace the Javascript button to Take Ownership on the Case to a lightning component like below Controller ({ recordLoaded: function(component, event, helper) { var ...
0
votes
0answers
14 views

The link you followed isn’t valid. This page requires a CSRF confirmation token. Report this error to your Salesforce administrator [duplicate]

Facing the error msg when I click on the button to go to sdoc template to generate a contract. Button url code is.. /apex/SDOC__SDCreate1?id={!Staff_Contract__c.Id}&Object=Staff_Contract__c Can ...
0
votes
0answers
27 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
21 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
71 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
34 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
48 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
75 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
474 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
36 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
66 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
56 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
31 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
48 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
36 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
40 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
43 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
57 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....

1
2 3 4 5
25