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
1answer
121 views

Assigning Case Owner on opening a Case

We have Email-to-case implemented which is assigning new cases to a Queue. Now whenever a user opens a new case, it should be assigned automatically to that user. For this I have written a VF page ...
0
votes
1answer
50 views

'Last Viewed By' Account field test - System.QueryException: unexpected token: 'null'

Trying to create a Last Viewed By field on Account. I'm newbish at Apex and not seeing what I'm missing here... I'm sure it's a rookie mistake. Adapting code from http://www.sfdcpanther.com/setting-up-...
0
votes
1answer
23 views

Based on Recordytype-selection i need to show or hide some values in standardcontroller and extension

When i change the record type value(technical or no technical) , i need to hide/show email__c, isClassTeacher__c and i need to show filtered picklist values based on record type selection for the ...
1
vote
0answers
38 views

Controller & Page data architecture [closed]

Does Salesforce Visualforce page have the ability to show table like this: For example, the data is Map, where key is Employee and Value is List of reports. Table should show which employees didn't ...
1
vote
1answer
38 views

What kind of test can I write to check the file?

I have a controller for VF Page. This code upload a profile's image (we can see it after that) and delete it. What kind of test can help me to check this file? I need to know, is it uploaded or not. ...
1
vote
2answers
122 views

Visualforce getters are called before setter when selecting a select option

I've noticed that when I have an <apex:selectList/> with a value attribute that calls a setter method to set a value in the controller all my getters get called before the initial set call ...
0
votes
1answer
300 views

get value from iFrame to visualforce script to controller

I am showing different domain website on iFrame window in my visualforce page. There is a button on that website "SAVE" (let's say). Once cx clicks on save button, I should notify too. How do I get ...
1
vote
1answer
375 views

Visualforce Input Fields not being passed to Controller

We're running into an issue where values being entered into a Visualforce page are not being passed at all to the controller for the save actions that take place. I'm sure this is something simple ...
0
votes
2answers
646 views

Visualforce Render condition not working when true

I have a custom visualforce page that has page blocks. When the render condition is false, I receive the expected results when previewing. The issue is when I change the render criteria to true and ...
1
vote
1answer
39 views

Passing an object parameter, containing employee enroll form on a Helper to Apex method in lightning

Currently, sending a Employee enroll input form on a object H_HRBasic__c to the apex class method CMP <aura:attribute name="HRB_S" type="H_HRBasic__c" default="{'sobjectType':'H_HRBasic__c', ...
0
votes
1answer
351 views

Pass Controller List Variable to VF Page

I have a custom controller and VF page. I'm trying to set up the page to render sections based upon the value of a field on the OpportunityLineItem object. However, I'm not quote sure how to get the ...
0
votes
2answers
19 views

Can't assign account to Contact

For a visualforce page, in my constructor i'm assigning a variable and retrieving an account from an associated opportunity - when I do a system.debug I get the details I want: myObject__c myObject = ...
-2
votes
2answers
106 views

Null pointer Exception in Apex controller

I am getting "FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object" in Apex controller when i click on update link pop up. Its showing in query with " ulstAsset ".I am newbie ...
1
vote
1answer
48 views

Only Start of Confirmed Built String Displays in Confirmation Popup Via Visualforce

With each inputCheckbox on my VF page checked, I'm adding to a string in my controller: public with sharing class ApplicationServerMonitorController { public String contactsAboutToEmail {get;set;...
1
vote
1answer
116 views

Getting multiple values from controller to visualforce page?

So I'm still very new to coding and Apex. I have a custom object called Invoice that is a part of a managed package that some users in my org do not have access to. So basically what I'm trying to do ...
0
votes
1answer
635 views

Test Class for a Custom Controller

How do you make a test class for custom controller? My search results involves this but trying to apply it in my test class only create too many error that I don't understand. public static ...
1
vote
0answers
63 views

It take some time for the method in Apex to become visible for the lightning component. What is a workaround here?

It take some time for the method in Apex to become visible for the lightning component. What is a workaround here? I mean literally: I create an Apex controller, create a method in it, then I create ...
0
votes
1answer
66 views

Group products by family [duplicate]

Updated I've updated the question because it was not clear and some of you gave me hints.What i originally want to achieve is the following example on visualforce page I want them to be grouped and ...
0
votes
1answer
34 views

Is there any possibility to edit a VF page that is in a managed package?

we have a custom object in which we are saving customer surveys. Once the case is submitted, customer gets an email with survey link(Visual forge page) and the response will be captured in custom ...
0
votes
1answer
462 views

Unknown constructor

I have a page that creates a CSV of account and related data, i am trying to add a block that shows the users related to that account via a contact. I have followed a few tutorials on how to make a ...
2
votes
1answer
2k views

ltng require scripts not working for me!

I'm having trouble accessing my static resource (a js lib) in my controller.js in my lightning component. My goal is to bundle up all my javascript functions and classes and use across most ...
1
vote
2answers
382 views

How to test in JS Controller if event has been fired or not

I have created a custom lightning component. There is a corresponding js controller which has a init function which calls a helper function. Now, once an event is fired the same helper function is ...
1
vote
2answers
254 views

What is the difference between page and component controller?

What is the difference between page and component controller? I stuck over the question when I read the documentation: Non-primitive Apex data types such as lists and sObjects are passed by ...
0
votes
3answers
857 views

Invalid Type Error

I am trying to fetch a list in my controller but I am not able to query the object directly and not even able to declare an empty list in my class Here is how I am declaring this in my class List<...
2
votes
1answer
1k views

Passing sObject List from Client Controller to Server Controller (Lightning Components)

Seems like I'm not being able to pass a sObject list to my server-side controller. I've seen articles and other forum answers that propose using JSON.stringify. I've tried that method, but my server-...
3
votes
0answers
341 views

Global window object in lightning helper

After getting an answer to Preserve a JavaScript variable between component calls of the client-side code question (which says there is a separate wrapper object around the browser's window object for ...
2
votes
1answer
234 views

DOM modifications from controller in lightning

While reading this article I met the following rule: Do not modify DOM in Controller. If you modify DOM in Controller it will call renderer method which will end in no result. The article looks ...
0
votes
1answer
224 views

How to pass record id from row to Test method?

I delete 1 record from table. How to pass into test method selectedMR(this record Id) and cover in test method from controller below? VF PAGE: <apex:repeat value={!mrItems} var="mrItem"> <...
0
votes
1answer
38 views

How to pass String from apex:inputext to current row of apex:repeat?

Page displays: String userinput (from apex:inputText) only in last row of apex:repeat. It doesn't allow to check is userInput=question.Correct_answer Image: Visualforce page: <table ...
0
votes
1answer
345 views

Pass object data to Apex using checkboxes on visualforce table

I am using Visualforce to list out a few different opportunities a checkbox for each one. My goal is to select an opportunity by clicking the checkbox, then pressing a commandbutton to pass that ...
0
votes
1answer
917 views

Setting default values via constructor does not work (Lightning Component)

I want to write a lightning component. The lightning component should show some informations about uploaded documents. Firstly I created the following class: public class DocInformations { @...
0
votes
1answer
29 views

How to create a single function in controller?

I have these codes in my 2 visualforce pages: <apex:page standardController="mycontroller" docType="html-5.0" standardStyleSheets="false" extensions="EditDelete" action="{!editItems}" sidebar="...
0
votes
1answer
341 views

Why DAY_ONLY(convertTimezone()) Query giving wrong results?

I need to display time retrieved from a dynamic SOQL and display at visualforce page using remoteaction. As we know code runs in system context and values in UTC time zone are retrieved. Is there ...
1
vote
1answer
84 views

Why is action not executed in controller?

My question is about why is an action not executed in the controller? I noticed this behavior previously in different scenarios, but I am going to explain the issue on a particular example - when apex:...
1
vote
1answer
71 views

No Controller found in test page

I have seen the error regarding questions posted for the patch: https://success.salesforce.com/issues_view?id=a1p3A0000008jMrQAI. However, On deploying my Apex classes and lightning components on my ...
0
votes
1answer
196 views

Visualforce - infinite redirection loop

I have the following Visualforce page that overrides the "View" action of a standard object: <apex:page standardController="Opportunity" extensions="OpportunityDispatcherCx" action="{!redirect}"/&...
-2
votes
2answers
28 views

How Can i cover the below code in test class

public Pagereference CancelRec() { GS_Mass_Debrief__c headerrec = [Select id,name from GS_Mass_Debrief__c where Name =:Apexpages.currentpage().getparameters().get ('Name') limit 1]; ...
2
votes
2answers
969 views

format .cls file in Visual Studio Code

What extension can be used in Visual Studio Code to format .cls files?
3
votes
2answers
904 views

ContentNote not inserting

I am trying to insert a new ContentNote and link it to an opportunity with ContentDocumentLink. However, after inserting the content note, the ID returns as NULL, so referencing it in the ...
0
votes
1answer
46 views

Having trouble getting value from server in lightning component

component <aura:component controller="AudioController"> <aura:attribute name="setMeOnInit" type="String" default="default value" /> <aura:handler name="init" value="{!this}" ...
1
vote
1answer
176 views

How to display value entered in apex:inputText as numbers with commas - currency format

I am using apex:inputText that holds a string with number(Integer) at controller side. Is there any way to display it as Number with commas (in USD Currency format)after typing input.
2
votes
1answer
646 views

get set from controller extension to visualforce page

I have a controller with extesion from which I try to pass the subtitle values to my visualforce page but I cant seem ro render it. My system.debug('subtitle 1 '+ subtitle ); gives : subtitle 1 {...
2
votes
1answer
714 views

Test Classes for Existing Salesforce Communities Controllers

I would like to increase my unit test coverage. I am using communities in our org. Salesforce comes with a bunch of existing controllers for communities: ChangePasswordController ...
0
votes
0answers
156 views

InputHidden not working with actionFunction

I'm trying to pass the value of an html input tag to an wrapper class into my controller. I'm using input tag because I need the slds style and others validation that I can't with a simple apex:...
2
votes
2answers
546 views

Invalid SecureWindow API, toString was blacklisted : Source Error in Lightning

I am new to Lightning. I have created Lightning component and a controller. Lightning component code: <aura:component > <ui:button press="{!c.doInit}"> <div class="testClass">...
-1
votes
1answer
32 views

How a component controller works

I am trying to access fname which is set to a value to display in the component . but fname is null. Please see the below code Page: <apex:page > <h1>Congratulations Page</h1&...
0
votes
1answer
989 views

Cannot read property 'set' of undefined when List<String> return in ui:inputSelect

All I want to do is retrieve picklist options from a custom object and fetch the inputSelect element in a lighning controller. I am trying this way.. but I am getting an error.. If someone knows any ...
0
votes
1answer
157 views

How to write testclass for vf lookup field

Below is the VF controller and test class <apex:form > <apex:pageBlock id="pb1"> <apex:pageblockSection title="Employer Details" id="empDetails" columns="1" > ...
0
votes
1answer
30 views

Attempt to de-reference a null object (at Custom Controller)

When I'm trying to change name of "Screen" I'm getting the error : Attempt to de-reference a null object Error is in expression '{!save}' in component in page demo: Class.MyController.save: line ...
1
vote
1answer
487 views

Internal Salesforce Error when calling Apex Controller from Lightning Component helper with custom model

I keep getting an "Internal Salesforce Error" when I call my Apex controller from my Lightning client-side controller. Here's my client code (helper): submitWelcomePacket : function(component, model)...

1 3 4 5 6 7 25