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
9 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
51 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
0answers
14 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
23 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 ...
0
votes
0answers
14 views

Alphabet filter using standard controller [closed]

I want to implement alphabet filter that is provided by salesforce using standard controller. Till now we have implemented the pagination but we would like to incorporate the alphabet filter too. I ...
-1
votes
0answers
22 views

Needs to show all attachments of a user in Custom visual force Page and also all Posts and Comments by user and Like Received for him [closed]

I have added the Page and Controller along with them.The issue is with file attachments and and Influence. Could u kindly help me on this. Visualforce Page <apex:page controller="...
3
votes
1answer
36 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
24 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
0answers
20 views

Default value on <apex: input> that is based on another variable

I have a custom formula field called "Open Quantity". I want whatever is in that field to be the default of the input box under the "Receiving Quantity" column on my visualforce page. Then be able to ...
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
23 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
90 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
27 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
19 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 ...
0
votes
1answer
98 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
21 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
39 views

Hot 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
33 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
31 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
43 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
36 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, ...
0
votes
3answers
45 views

my if condition is not working..else condition is working fine…somebody please told me what is wrong

public class BookingCltr { @AuraEnabled public static void CreateRecord(String conObj, String bookObj){ contactObject con = (contactObject)JSON.deserialize(conObj, contactObject.class);...
0
votes
1answer
11 views

Feed Streaming API Details to Visualforce Controller

Our sales managers want to buy a product called Hoopla but we don't have the budget, so I've been asked to build something in-house. The product does quite a bit, but the pieces they're most excited ...
0
votes
0answers
25 views

Duplicate Rule Bypass with RecordEditForm in Lightning

I am struggling with figuring out how to pass dml.DuplicateRuleHeader.allowSave = true; in Apex on a Lightning RecordEditForm component. I am using RecordEditForm as a record creation form and ...
0
votes
0answers
28 views

How to query data from related objects without lookup (ProcessInstance and TargetObject) for use in a LWC?

I am hoping to build an LWC for displaying pending Approvals related to Opportunities, as well as a number of field values from the Opportunities themselves. Since the ProcessInstance and child ...
1
vote
1answer
45 views

HTML Email Templates delivered Incompletely in Lightning List Email

I have few html email templates which are used to send mass emails to Contact and Campaigns. They are working fine in Salesforce classic whereas in Lightning, they are delivered incompletely. We need ...
0
votes
1answer
35 views

Value of the Multiple child record of One Parent on the VF page:

I have completed around 100% of the requirement , only part i am struggling to show the correct value of the two boolean field against there Parent For ex : Parent A : Child 1: (Field -- ...
0
votes
1answer
40 views

Prevent user clicking outside Custom lightning component

I have a parent custom Lightning Component which includes a custom lookup component inside, for Account Edit/Create. I want when the user starts typing (and results start to appear in a drop-down list)...
0
votes
0answers
10 views

How to Show Specific Options for Lookup Field in Visualforce Page

Is there a way to specify what values are available for a lookup field that is on a custom visualforce page? The requirement is to only show certain values on a page that is creating a new object, so ...
0
votes
1answer
40 views

For loop to check if a list contains a string

I have a picklist on a visualforce page and I'm trying to filter by namespace prefix to display objects belonging to a package as well as the account and contact objects. I have the for loop below ...
0
votes
0answers
13 views

How to get email from Account for user while creating user in Salesforce

Below is the controller which will create a partner user in Salesforce. In this code, I'm getting email from auth provider data.email. But I need to get it from the user's related partner account. Can ...
1
vote
0answers
14 views

Initials Profile Picture

I am trying create a function to display the initials of the person (not the current user) if they don't have a profile picture. I have all the initials stored in a list in my page controller. Can ...
0
votes
1answer
39 views

URL No Longer Exists ParentId=ApexPages.currentPage().getParameters().get('ParentId');

I have a VF page that allows child records to be updated , this is working well.EXCEPT for the following page I am trying to use ParentId=ApexPages.currentPage().getParameters().get('ParentId'); and ...
0
votes
1answer
78 views

How to read/write data from lightning:buttonStateful in lightning component

I need functionality similar to the "follow" button in a lightning component. I'm using the stateful button as described in the lightning component guide: https://developer.salesforce.com/docs/...
0
votes
0answers
19 views

OnChange input picklist field page message is not showing

I am writing a VF page where my requirement is that I have a input picklist field. When I change the picklist value it is calling to controller method. And when in controller I have written a page ...
1
vote
1answer
142 views

Change the case status through Omni-Channel on accept event

I am using Omnichannel for acceptance of the case. The requirement is that when an Agent accepts a case, the case status should be updated to 'In Review'. I have created the trigger on the AgentWork ...
0
votes
1answer
39 views

Apex page failing DML transaction

Let's have a very simple apex page: <apex:page controller="EventInsert" > <apex:form> <p>Event insertion test</p> <p>{!processParams}</p> <apex:...
0
votes
0answers
31 views

How to display alert if a custom listview button (VF) doesn't get records

I'm trying to show an alert in a Visualforce (custom listview button) if the controller receives less than 1 or more than 99 id's. The VF get's the integer from the apex controller once a listview ...
0
votes
0answers
20 views

ApexPages.message not showing in first VF when redirect to another

I have two VF with the same controller, the second one I used it as a CSV file, I need that in the First VF a Apex.Message shows and then downloads the CSV file. Part of the Controller. ...
0
votes
0answers
26 views

Controller property set to null after actionPoller execution

I am assigning controller properties with some value in its constructor. I am using <apex:actionPoller /> on VF page and it is rerendering some part of visualforce page section. But it not ...
0
votes
1answer
160 views

How to get selected pick list values with Apex for Aura Component

I have established a custom field called "Products Used" on the account object with a variety of banking products to choose from. I am trying to program an Apex controller to query the selected ...
0
votes
1answer
52 views

Delete Row button from List of record not working in Visualforce page

I am writing a VF page where I have to show list records with Add/Delete button. when I click Delete (X) button it is deleting the record and removing that particular row. But if I am adding a row ...
0
votes
2answers
66 views

How to simulate visualforce page button in test class in order to deploy it?

Hi I have an Apex class which is called/invoked from a custom button called "desiredLocationsPage" , I have created the custom button in production like below; I have tested my test class in sandbox ...
0
votes
1answer
75 views

Lightning Component redirecting to record it is creating

I am trying to create a new record using a save button on a lightning:recordEditForm Im am fairly new to coding lightning components and have come to a bit of a standstill trying to get it to ...
3
votes
1answer
65 views

Redirect to VF Page not firing

Good day, I posted this over on the Salesforce Dev community forums but have gotten no responses. I'm hoping someone here might be able to assist. We have a call center application integrated with ...
0
votes
1answer
43 views

How to assign field values to a constructor in Apex Test Class?

I am trying to test my custom controller's saveNewContact() method. I am trying to set the fields on the page, or in the constructor contact, and attempt to save the record. Unfortunately, when I run ...
0
votes
2answers
34 views

<apex:inputSecret> auto populate is not working?

I want to display password value as secret and it need to be auto populate from salesforce without passing manually. I can able to display username but password field display empty. Anyone help ...
0
votes
2answers
132 views

userinfo.getuserid() returning null in test class

I have a test class which inserts partner user for testing. So, when I pass userinfor.getuserID(), it is returning null due to which my test class is failing with error "System....