Tagged Questions

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

0
votes
1answer
15 views

Records truncated end of page in PDF

I have an apex PDF page. There are five different tabpanels to show records. Now when number of records increases the last record of last panel in a page gets segregated to the next page. In such ...
0
votes
1answer
21 views

Filter list of records in controller displayed in an apex:pageBlockTable

My code is based on code shared by another stackexchange user. https://stackoverflow.com/questions/26183938/visualforce-page-does-not-display-a-list-of-records-or-any-records-but-it-can-di Where in ...
2
votes
1answer
26 views

Custom object to track event attendance

I've created a custom object to add an 'Attended' checkbox for invitees to an event. I've created a visualforce page list the events with a link to the attendance page where they can see a list of ...
1
vote
1answer
21 views

Can I use this method as the argument in a ternary operator?

I'm using the jqGrid plugin for jQuery. In the jqGrid function, I want to pass in a value for the width, but I want to pass in the value depending on the outcome of a method in my controller. ...
2
votes
1answer
19 views

Test custom controller that does not use parameters directly

Given a custom controller that uses a record selected by a standard controller (not through id parameter), how can I ensure that the appropriate Custom_Field__c field is available in the unit test? ...
1
vote
2answers
24 views

getting Id in apex controller without using standard controller ApexPages.StandardController

I have one apex page IncForRep that rerefs a controller IncForRep. i have used this constructor public IncForRep(ApexPages.StandardController a){..} to use Id i=a.getRecord().get('id'); . I want ...
0
votes
1answer
18 views

Create Visualforce page that opens up on hyperlink

There is a VF page OpenIncidentsByRep that shows columns having User Names and no. of Incidents of that User, referring from Incident object in a single row. The Number field is an hyperlink. I need ...
0
votes
0answers
15 views

Filtering form insert on master-detail relationship

I have a form on my html based visualforce page where users can submit comments on a topic I post. I am using a Challenge custom object and a Challenge Comment custom object. These are both connected ...
1
vote
0answers
56 views

Record Name not created when creating visualforce page

I have a custom button on a child . This button allows the user to create a new child object in visualforce from the related list on the parent. However, the child's related list are not showing. I ...
0
votes
1answer
34 views

I want sync salesforce objects and my web application. How? [closed]

How to sync salesforce custom objects and my web application? I already tried that but I am fully confused with that. Please tell me how can I proceed ?
0
votes
1answer
58 views

Display Records Dynamically based on Date Filters

Using two date filters displayed in the VF page I would like to render the records in apex:pageblocktable. I am pretty new to Visualforce and this is what I have built so far. VF Page <apex:page ...
3
votes
0answers
35 views

Internal Server Error in Partner communities when using extension controller

We have a appexchange app in which there is a global class. We are using this global class as controller in local VF page and also created a extension class. When i try to use the variable declared ...
5
votes
2answers
88 views

Test Class SeeAllData=true Annotation

I am creating a test class that will test my controller class which uses almost 5 to 8 objects that has many DML statements like insert and delete, however I am feeling a little bit worried about not ...
0
votes
1answer
42 views

JavaScript executing before controller method finishes

So I have an action function which calls an apex controller method. I call this action function within some javascript at the top of my page and after that call I want to send some information to ...
1
vote
0answers
32 views

Unable to create an instance of extension {CLASS NAME}

I'm getting this error, i'm sure I what this means. I couldn't find anything helpful anywhere.
1
vote
1answer
29 views

Checking if object exists on controller

I'm trying to handle the edge case where a user hits my page without the Id being set for whatever reason. However, I'm having problems detecting when no object is loaded. I tried this: private ...
2
votes
1answer
120 views

How does one test Visualforce components with custom controllers

I have created a custom Visualforce component. It is backed by a custom controller. I am struggling to write unit tests for it. The limited VisualForce documentation indicates that to test it I ...
2
votes
1answer
32 views

Accessing Controller Property from VF page

I have a Controller property that displays the record type name of a Case. I just need to display the record type during Case Creation or Editing. This should be a read only as such I decided to use ...
1
vote
2answers
24 views

Expression cannot be assigned at line

How could I assign a value to a dynamic query field? I want to make an update of a record. ac.get(campo) = totalAcumulado.get((String)ac.Name); <-- Expression cannot be assigned at line This ...
5
votes
3answers
254 views

What controls the 'severity' of ApexPages.addMessages(exception)?

I'm trying to crystallize out some 'best practises' for Visualforce Page exception handling. I think, at a minimum, a page should look something like this: <apex:page ...
2
votes
1answer
47 views

What is the difference between initializing properties in shorthand vs constructor?

I thought these two samples would be functionally equivalent. But they behave differently: Initializing a property in the constructor: public with sharing class LeadController { public ...
1
vote
1answer
96 views

Uncheck checkbox using javascript after JS onload

I am pasting a complete code for anyone reference if they like to resolve it.(Just incase they want to know what i could be missing.) NOTE: CaseOwnerChanged__c = Checkbox field type <apex:page ...
1
vote
2answers
59 views

Accessing the fields of Database.query() results

Database.query(query) returns sobjects. I want to access each fields in this sobject to check the value on each field. How is this done in controller?
1
vote
1answer
33 views

Combine multiple PDF's together and attach them in a mail?

As of now , all i have is a VF page which renders as a PDF and it needs Account ID to be passed to generate a PDF . Is there a way wherein i can group all the PDF's into a single PDF ? Should i change ...
2
votes
2answers
47 views

Inline vf page to Related Section

Is there any way to put inline visual force page to related list section of case object?As per my understanding we can create new section above the related lists and we can put over there..but i ...
0
votes
2answers
160 views

passing data from Page controller to component Controller

I want to pass list of record from VF page controller to component controller but when i access variable in component controller using object creation then i am getting null value. I am taking Example ...
0
votes
0answers
50 views

Sorting Aggregate Results VF Page

working with VF Page page block table and attempting to display count of "sales" broken up by different carrier buckets. In my SOQL Query, I am able to easily get the rep's name and total number of ...
-1
votes
2answers
62 views

Test class for new case controller

I've recently been writing a few basic controllers for some visual force pages, and of course now need to test them. Problem is I don't really know how. Normally you know you'd instantiate the class, ...
5
votes
1answer
116 views

JavaScript Remoting and optimal Angular.js architecture

Background I am starting to build more and more apps with angular, inside of a Visualforce container. Since many of the database services rely on some apex logic, the services layer uses JavaScript ...
1
vote
1answer
133 views

Need to Filter a VF page with date input and pass to SOQL statement in controller

I have been working on this for a few weeks now so any assistance would be wonderful. I am trying to create a report with a VF page to pull information from some custom objects and their associated ...
1
vote
1answer
52 views

Controller to place opportunity products related list on case page layout

I am trying to create a controller to view opportunity line items on a case that is related to an opportunity. I am not a developer, and copying and pasting code. I am currently receiving an error: ...
4
votes
1answer
182 views

Winter 15 preview new error messages: valueOf() function

We have been experiencing serious issues today with the release of Winter 15 into our sandboxes... Salesforce System Error: 1702643372-49547 (938791604) (938791604) Error is in expression ...
0
votes
1answer
100 views

Display message on parent window after closing VF Popup

At the moment I have a button placed on my Opportunities page which opens a popup, on my sendRequest() function this popup is closed. What I would like to do is further improve this function to also ...
3
votes
1answer
72 views

custom controller with extension

What are some use cases in having a custom controller with extensions? Does it make sense to have something like this? EDIT2 Edited out the error I was receiving - apparently in my extension I was ...
0
votes
1answer
34 views

Visualforce tab to track order details

To capture all the order details I built a VF page with an extension to get all the orders details for the current user. Following is the way I tried... public with sharing class Order_Extention{ ...
2
votes
1answer
86 views

Apex properties in helper class

I have an apex helper class named "PricingConversion" called from my apex controller "DeaRowEdit". PricingConversionHelper.CalculationSecondPricingTon(dealrow); I would like to move the properties ...
1
vote
1answer
30 views

Call variable from extension with JavaScript

This is my controller: public with sharing class MyController { public myObject__c myObj {get; set;} public String myObjectId; public Boolean one; public Boolean two; public ...
1
vote
0answers
51 views

CurrentPage getParameters() is empty the first time I post to a page

I have a VisualForce/APEX page that I am posting to through a form. I send over a list of contacts as a single string. When I get to the other page I use the following code to retrieve the post ...
2
votes
1answer
55 views

Visualforce how to onSubmit via controller return error or true

I currently have a Visualforce page where a User can tick selection boxes in order to edit multiple License Voucher # Object fields as shown below. I would like to perform a field check for empty ...
1
vote
2answers
44 views

Invalid type: ConnectApi.User​​GroupPage

I'm working on a Visualforce page where I want to grab a user's groups and paginate over the list. Getting the groups is pretty straightforward using the ConnectApi's ChatterUsers.getGroups method ...
0
votes
0answers
21 views

Insert Image Blob data into salesforce as an attachment using apex contoller [duplicate]

I need to insert a image into salesforce using apex controller . I am getting Blob data from javascript to apex controller. Now i stuck up in inserting the image into attachments. I found that the ...
0
votes
1answer
47 views

Want to upsert Attachment base on parentId

There is no external id column for Attachment object, but the requirement is to insert Attachment for the parentId if there is no attachment present else use the already existing one. Please suggest ...
1
vote
1answer
37 views

VF inputText field to filter a wrapper list containing custom SObject

I currently have a wrapper list containing custom sObjects and checkboxes. I also have a inputText field on a Visualforce page and would like to filter the wrapper list by License_Voucher__c which is ...
1
vote
1answer
27 views

call dml insert listofSObject from a controller that is referenced in apex page

Is it possible to call dml operations like insert list_SObject ; inside a controller method that is refrenced in visualforce page not some trigger class? please give some references.
1
vote
1answer
92 views

Map<String, List<Sobject>> reference inside apex method

I've a Map getter Map<String,List<Call2_vod__c>> mapProductEntity ; for(Account p: [SELECT Name, (Select call_date_vod__C,signature_vod__c FROM Call2_vod__r from Account WHERE ID IN : ...
0
votes
0answers
18 views

why do we need extension for controllers [duplicate]

I am new to SalesForce , I just learn about Standard controllers ,Controllers and Extension to these controllers. But what I do not get is why we need extension to the controllers ? By that I meant, ...
1
vote
2answers
98 views

String / Date comparisons Custom Fiscal Year

I have custom fiscal year starting May 1st to April 30th. I want to find a clever way to select a picklist value based on opportunity closed date. Picklist values 2010 through 2020 Here is the ...
2
votes
2answers
340 views

Call a method in controller from Component (not in Constructor)-Visualforce

<apex:component> <apex:attribute name="l" description="l" type="double" assignTo="{!Received_L}"/> <apex:attribute name="varLng" description="t" type="double" ...
2
votes
2answers
69 views

Passing a value from a VF Page to Controller

I have been working on this on and off for quite sometime now, and have hit a wall. So what I'm trying to do is pass a Super Customer to my controller where it will get picked up and pushed over to ...
0
votes
1answer
89 views

View State and Heap Size too large

I am trying to execute this Apex code but getting view state size of 196 KB and Heap size error. I tried to find where the bulk of view state is going to and it seems to be this controller. Could ...