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.

learn more… | top users | synonyms

1
vote
1answer
28 views

Setting values in the controller from VF page

What I'm trying to do: at the onblur event for an inputField, I want to update an outputText based on the contents of that inputField. Here is my code: <apex:page standardController="Opportunity" ...
0
votes
0answers
19 views

SOQL to self lookup. To display on a VF page [on hold]

I have a scenario where I have object Activity, a lookup field to same object and a checkbox. A activity can be a main activity and can have many child activities(lookup). I have a VF Page where each ...
1
vote
1answer
30 views

Can actions/methods in the client controller (Javascript) and server controller (APEX) have identical names?

In the documentation I found the following tip: Use unique names for client-side and server-side actions in a component. A JavaScript function (client-side action) with the same name as a server-...
0
votes
0answers
17 views

How to have a count on the number of times an <apex:outputLink >has been clicked?

I want to count the number of times an output link has been clicked,and populate that value to a custom field,How can we achieve that? My code is as follows: Visualforce page: <apex:page ...
0
votes
0answers
20 views

How to display records using pagination with scroll bar using Div Tag [closed]

using div tag display contact records, First Display 10 records using pagination in visual force page and assign custom buttons that page. When i click Next Button Display remaining records. i did ...
-3
votes
1answer
43 views

How to convert List to a Map?

I have a List<custom_object__c>. I want to convert to a Map, where the ID is the String and the value to be an custom_object__c object. Map<String, WrapperEmployee> mapEmp = new Map<...
0
votes
2answers
40 views

How to get Contact records using apex:repeat tag in visualforce page?

Using apex:repeat Tag how to get All Contact Records in visualforce page .I have to achieve this without using apex:pageBlockTable and Standard Set Controller..
0
votes
2answers
13 views

Make all campaigns in Opporunities' - campaign influence related list as PRIMARY CAMPAIGN SOURCE

As shown in the below picture, Opportunity - 'Ethan Hunter' has two campaigns under campaign influence related list. In that Chat Campaign is marked as Primary Campaign Source. I would like to have ...
-8
votes
1answer
48 views

First Display 10 records Then when scroll is touches the down arrow Remaining 10 Records Dispaly Total 30 records [duplicate]

In my Contact Object Having 30 records By Using Pagination First Display 10 Records and when i scroll down touches down arrow display remaining 10 records... how to do this scenario in visualforce ...
0
votes
0answers
30 views

When Scroller Down to touches Down Arrow show the Contect Object Records using visualforce page

First i dispaly Contact of 10 Records when i click CommendButton (Next) display Next 10 Records then assign a scroller First Dispaly 10 records When Scroller Down to touches Down Arrow show the ...
1
vote
3answers
28 views

Getting radio list from another class

I have a visual force page that uses a standard controller and I want to use another class on the same visual force page? How this can be achieved? <apex:page standardController="...
1
vote
2answers
48 views

apex:repeat to show and edit multiple record

I've created a simple VFP that uses an apex:repeat to render a list of custom objects. These objects are displayed as a preview image with a quantity field. This is going to be used to allow people to ...
0
votes
1answer
34 views

addReply method not working showing error System.QueryException: List has no rows for assignment to SObject

Apex Class: when click on parent its show this image its a self relationship public class PrivateMessageController { public List < Private_Message__c > lstPrMsg { get { ...
0
votes
2answers
26 views

Getting INVALID_FIELD_FOR_INSERT_UPDATE exception while inserting record

I want to insert a record of custom object Positions__c from VF page using CUSTOM CONTROLLER. Howevere, I am gettin below exception: System.DmlException: Insert failed. First exception on row 0 ...
0
votes
1answer
99 views

I wanna reset an Aura attribute to a blank sObject type.How to achieve this?

I have an Aura attribute as follows: <aura:attribute name="newItem" type="Camping_Item__c" default="{ 'sobjectType': 'Camping_Item__c', 'Name': '', '...
1
vote
0answers
12 views

VF Email Template With VF Component Not Working For Community Forgot password

I had changed Email template for "Forgot Password" as VF Email Template that contains a VF Component in Salesforce Community. But when that VF Email Template -->VF Component have controller then email ...
0
votes
0answers
19 views

using StandardSetController pagination working but disable previous and first button not enable when we next button or last

this is my class public without sharing class TaskAssignmentDashboardController { public list < contact > clist {get;set;} Public Integer size {get;set;} Public Integer noOfRecords {...
0
votes
1answer
30 views

Count of Records in Controller

I have a controller below that mimics the Case Comments related list on a Visualforce page. I would like to be able to get a count of the related list records so I can conditionally display the ...
0
votes
0answers
36 views

VF Controller - ForEach error and query issue

Ok, for some reason the dev console keeps throwing this error when I add the for each statement: "expecting right curly bracket, found 'for'" If I exclude that statement, then I get an error on my ...
1
vote
1answer
29 views

Merge field stored in custom setting

Is it possible to store a merge field like {!Account.Name} as a custom setting, then reference the custom setting on a VisualForce page that uses the standard controller?
0
votes
2answers
34 views

spinner not showing when click on search button

spinner not showing when click on search button <apex:stylesheet value="{!URLFOR($Resource.SLDS080, 'assets/styles/salesforce-lightning-design-system-vf.css')}" /> <apex:page> <apex:...
0
votes
1answer
36 views

Pass value of inputfield to controller without binding it to any object

I a div popup where there is an input field <apex:inputfield id="CommentDate" value="{!AModel.dateTimeofComment}"/> <apex:commandButton action="{!AModel.saveComment}"...
0
votes
1answer
22 views

pageblocktable and total record label show wheninsert text and click on search button but it show on page load

yellow colour mark area not show before click on search how to use render i have take boolean variable which name is flag this is my class public class nestedqueryexample{ public string ...
1
vote
0answers
41 views

Need help || System.VisualforceException: Read access denied for null, controller action methods may not execute [on hold]

Please help me resolve this VF Code <apex:outputPanel rendered="{!if((showDone && alreadydeparted), true, false)}" id="nextBtnPanel"> <!-- ACTION STATUS FOR DISABLE ENABLE NEXT ...
0
votes
1answer
8 views

show contact name as link but when click its given error not showing details page

Showing Error : The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two ...
0
votes
3answers
45 views

How to call the Boolean variable from apex class to vf page

Could you please help me on getting the value of the boolean variable from apex controller method to VF Page. First i will tell my requirement, If the user unable to update the record "eruObj" he ...
-1
votes
1answer
18 views

not copying mailing address(contact) into billing address(Account)

this is class public class CopyAddressTriggerController { public static void perform(set<id> ids){ List<Contact> con = new List<contact>([SELECT Id,name ,...
0
votes
1answer
10 views

lastupdated contact address store in asscociated account address using trigger

Showing ERROR : but showing Compile Error: Invalid foreign key relationship: Account.contacts when user create contact with assocate there parent account and insert mailing address in contact ...
0
votes
3answers
87 views

Pass selected value from html <select> to controller

I have to pass the selected picklist value by user from apex form using <select> and <options> html tag to a standard controllers picklist field. I am unable to get the values from Page ...
0
votes
0answers
15 views

i want to perform search operation according to the selected check box and display the result in pageblocktable? [duplicate]

Visualforce Page <apex:page Controller="actionSupportController"> <apex:form> <apex:pageBlock> Household Name: <apex:inputText value="{!ID_c}"/> ...
1
vote
1answer
28 views

action support returning empty value

when i click on the column action event working when i open the log coming with null value... values are not displaying in the table. <apex:page controller="actionSupportController"> <apex:...
1
vote
2answers
85 views

Trigger -Error Invalid initial value type List<User> for Set<Id>

Requirement - Checkbox in User NoOwner__c. If it is checked and I am going to update account Owner then it needs to throw an error else needs to save record. I am getting error Invalid initial value ...
0
votes
1answer
47 views

How to get the Salesforce Lookup id from visualforce to apex

I have public Opportunity destOpp {get; set;} in my apex code. I have <apex:inputField label="Source Account" value="{!sourceOpp.AccountId}" /> in my vf page. After I select an account from ...
2
votes
1answer
38 views

Why am I exceeding viewstate when using button+actionfunction, compared to using commandButton?

I have a very simple page: <!-- vf page --> <apex:page standardController="Challenge__c" extensions="upsertChallengeResponse" sidebar="false" tabstyle="ChallengesVF__tab" ...
0
votes
4answers
73 views

Find the number of open Opportunities

I want to find the number of open opportunities related with Account object and autofill the custom field of Account object with the numbers of open opportunity...
0
votes
2answers
37 views

Trouble relating second object for dynamically added records From Controller Extension

I'm editing this, as I just realized that the two objects are being saved, but they are not being related. These two objects are related via lookup. I'm relatively new to coding, and haven't been ...
3
votes
1answer
42 views

Error messages not getting removed on reloading the page,when I've overridden the view with a visualforce page

I have overridden the standard view of Account object with a visualforce page,& using a custom button that is used to send email to Account,using a custom field,Email__c.The error appears if we've ...
2
votes
2answers
28 views

Advance search in Visual Force

I need to implement advance search (smart search) in my VF page. I will have a search input field, once i start entering values in the field it should query the values in the DB accordingly and ...
1
vote
1answer
60 views

Redirect to Visualforce Page After Record Type Chosen

I am trying to redirect users to a VF page after the record type is chosen when creating a new Case. If a particular Record Type is chosen, the use should be brought to a VF page, anything else ...
0
votes
0answers
23 views

How can we chain Lightning component controller call outs to Apex controller

I want to chain lightning component controller methods based on results received from first to second callout. I tried multiple ways but without success 1. Continuation - possibly only for Vf pages ...
0
votes
1answer
21 views

cover standardcontroller extension in test class

public DiscoverOrg_ConflictResolver(ApexPages.StandardController controller) { LoadPage(); // Research request start reportSubmited = ''; reportNotSubmited = ''; ...
1
vote
1answer
30 views

access custom object field in inline visual force page

I have two custom objects contact and property. I would like to embedd a visual force page in the contact custom object which would do the following. 1) Access a field in the contact object and fetch ...
1
vote
2answers
72 views

How to pass an array of a class from a helper to an apex controller

I have created a class with several fields like this: public class Tier{ @AuraEnabled public String Name {get; set;} @AuraEnabled public integer Min {get; set;} ...
2
votes
1answer
63 views

Get the specified child relationship Name from Parent

I have a VF component where I am trying to get related list(child) of any record( say Account, depends on the value I give in my VF Page). I have two attributes in my VF component , objectvar- which ...
2
votes
1answer
28 views

calculate EndDate based on only weekdays

I have a function which takes input as startDate and return the endDate where endDate is Date after 100 days excluding weekends. That is only weekdays are counted and not the weekends in the 100 days ...
1
vote
0answers
15 views

Bypass error rule in controller

I have a error manager rule in controller at quote line item level. Scenario is whenever a particular product 'X' is added by the sales manager ... dates field should be filled in. But if the same ...
-1
votes
1answer
53 views

How to clear the values of textbox on button click

VF Page: <apex:page controller="petwizardcontroller" sidebar="false" id="page"> <apex:form id="frm" title=""> <apex:actionFunction name="sayHello" action="{!doSearch}" ...
0
votes
0answers
17 views

How to get Updeteable field value and uneditable field value from VF page.

Actually here i am now trying to get the "value" input field's string but the problem is i am switching the text box of value according to the case Field value since few fields don't allow us to edit ...
4
votes
1answer
196 views

Uncaught TypeError: a.getAttribute is not a function

Scenario: I have a component that has an <aura:renderIf> within an <aura:iteration>. The <aura:iteration> references a component attribute called "selectedItems" to display a list ...
0
votes
1answer
44 views

querying related child object from parent in VF componenet

I am trying to build a reusable VF component which can return all the child of an parent object. I just assign the parent object in my VF page and rest is taken care by the VF component to display the ...