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
1 vote
1 answer
37 views

Gack Error Id : 2020409769-104966 (551437190) when there is no constructor without parameters

When a Lightning Action is called from LWC and a DTO model instance is passed, where the corresponding DTO Model class doesn't have no arguments constructor, an internal error is shown: Gack Error Id ...
  • 14.7k
-2 votes
1 answer
48 views

How to write test class for this? [duplicate]

public with sharing class ToggleController { @AuraEnabled(cacheable=true) public static List< Contact > fetchContact (Id accId, String status) { return [SELECT Status_c, ...
  • 1
0 votes
0 answers
26 views

VF controller not maintaining instance variable value

public without sharing class PaymentSuccessController { public Boolean emailSent = false; private List<String> rlis; public List<String> getReceiptLineItems() { if (...
-1 votes
2 answers
43 views

How to combine these method into one?

public with sharing class bot{ @AuraEnabled(cacheable=true) public static List< Contact > fetchActive (Id accId) { return [SELECT Status_c, FirstName, LastName, Email FROM Contact WHERE ...
  • 1
0 votes
0 answers
23 views

Lightning Flow Navigation using Aura Component

//auracomponent.cmp file <aura:component access="global" implements="lightning:availableForFlowScreens"> <div class="slds-align_absolute-center" style="&...
-1 votes
1 answer
48 views

Lightning Table Not Display Data

I've been wracking my head the whole day at this, I'm very new to Salesforce and trying to create a Lightning Component that displays Contacts and what Commission they've earned. I'm just not getting ...
  • 3
0 votes
0 answers
16 views

actionFunction - controller method doesn't run even though oncomplete does

I am trying to get a controller method to run using an onclick actionFunction, but the method does not appear to execute, even though the oncomplete does. Here is the code: Controller: public with ...
  • 143
1 vote
1 answer
51 views

Change the apex:commandButton value from 'Return to Uploader' to 'Done' from Javascript (Jquery)

I have a requirement to change the value of apex:commandButton from 'return to uploader' to 'Done' using Javascript(Jquery). Below is my VF Page code: <apex:commandButton style="float: right;&...
0 votes
1 answer
42 views

Issue while passing inputfield value from vf to custom controller

I have a VF page through which upon selection it is creating an Agreement record. As per the current implementation record is created successfully but inputfield value is not getting passed to the ...
  • 35
1 vote
1 answer
50 views

"Failed to parse CONTROLLER for FaceMesh in Aura component"

I am trying to use the FaceMesh object from the MediaPipe library to detect and track faces in a video stream in my Aura component. However, I am getting an error when I try to save my component that ...
0 votes
0 answers
32 views

When I preview my VF Page it renders blank (nothing is in the preview). What is wrong with my code? Or am I just testing it wrong?

When I preview my VF Page it renders blank (nothing is in the preview). What is wrong with my code? Or am I just testing it wrong? Things of note: It's using an invocable method and returning a list ...
1 vote
1 answer
37 views

Unknown Property Error "Create Apex Property" when creating Visual Forcepage

I am attempting to save a Visual Force page that is accepting input values from a flow and passing them into an invocable method. It keeps saying the custom object I'm using in the invocable method is ...
0 votes
1 answer
51 views

Unknown Property Error using Custom Controller When Trying to Save Visualforce Page Pointing to a Controller

I am using an invocable method along with a controller to feed a list of records being returned from the flow and invocable method, into a VF Page in order to render multiple records with the field ...
-1 votes
1 answer
54 views

Visualforce Page: Group by Company and Consecutive Date Ranges

I have created a Visualforce Page .pdf to output Candidates and their previous Work Experiences. On the Work Experience records there is a lookup field for Company as well as fields for Title, Start ...
0 votes
1 answer
42 views

SFRA - Cartridge for payment methods returning an empty list

I'm currently exploring how to extend Salesforce's API. I currently have a Controller that tries to retrieve the payment methods available. The problem is that it's returning an empty list. There are ...
  • 11
0 votes
2 answers
75 views

Unable to pass parameters to visualforce page - Error "Value provided is invalid for action parameter 'templateId' of type 'Id'"

I have a visualforce page that I'm using to redirect a user to a second and final visualforce page in an attempt to bypass a CSRF Token request (it's from a managed package). I can't seem to get the ...
  • 11
-1 votes
1 answer
19 views

AccountContactRelation Variable In Apex Controller

I'm not receving any errors in the following, however the table in the VF page is not rendering. Would appreciate any advice on what is incorrect here, or if I'm completely going about this wrong. ...
0 votes
0 answers
59 views

Get Usernames from Ids in Apex

I am wondering how to get usernames given the user ids in the server-side controller. I would then like to add the username property and value to the objects in indexLogs. I am a new FE engineer, and ...
1 vote
1 answer
60 views

Updating Controller to Include Tasks Related To Account Opportunities

I have been asked to update a Controller used for a custom 'Recent Activities' LWC on the Account layout. Right now the Controller is querying Tasks related to the Account and displaying them in the ...
  • 55
0 votes
2 answers
90 views

Visualforce - Rich text substitute style= "" with style="margin-top: 0pt; margin-bottom: 0pt;"

I have three different issues. To start with, we have a custom solution to generate contract/offer documents (PDF) through Visualforce. The terms and conditions are saved in a rich text field of ...
0 votes
1 answer
164 views

Input on Visual force page form with Controller

I am new to visual force pages and have gone through some trailheads but am stuck on this part. Basically I want to submit an id from a contact record on the page and from that I want to query my ...
  • 141
0 votes
1 answer
119 views

How to add an object into another object - ES5

var filters = {'sort': 'asc', 'query': 'id=1'}; var data = {}; data.search = {'type': 'manual'}; Object.assign(data.search, filters); When using ES6 this code works correctly. But when it's in ES5 I ...
1 vote
2 answers
142 views

How to make a button disappear after clicking on it in vf page?

I created a save button in vf page VF Code <apex:page controller="Buffer"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons location="...
2 votes
1 answer
89 views

Not able to change the name of a contact from a vf page?

VF Code <apex:page controller="Buffer"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons location="top"> <...
-1 votes
1 answer
196 views

Update an object that is indirectly related to another object in a list

I have a list of custom object (Meeting Note) and I want to be able to edit a custom field (Firm Type) from another object (Net Prospect Score) that is indirectly related to the Meeting Note object. ...
-1 votes
1 answer
61 views

how to call a function of vf page script from vf page controller

I have a VF page and in script tag of that VF page I have a function. Now I want to call that function from VF page Controller. How can I call VF page script function from its Controller bcoz i want ...
0 votes
1 answer
47 views

VF Page is getting refreshed when clicked on an Enter key in apex:inputText box

I have an VF page which has the apex:inputText. When I click on Enter button, the whole VF page is getting refreshed/rerendered for no reason. I have no onkeypress events on top of the inputText box. ...
  • 37
0 votes
0 answers
110 views

How to install custom NPM packages in Salesforce Commerce Cloud

I want to install an package from NPM to use inside my cartridge code, but every time I try importing I receive the following error Error: Module "{{package}}" not found. (*/cartridge/...
  • 105
0 votes
1 answer
237 views

Aura Component Attribute Value

I would like to set a lookup id value for an Aura attribute, but it doesn't work unless i hardcode it. Instead I need to retrieve it from the lookup on the current recordId. How is this possible to do?...
1 vote
1 answer
38 views

How to avoid saving other records in a custom VF page

I created a custom list of Event records using a custom controller and Visualforce page. In the list, the user can edit an Event but after saving the change, it also changes the last modified date of ...
1 vote
1 answer
256 views

LWC controller returns empty objects

guys! I have a problem. Every time, when I'm trying to execute quick action i see this error-message: [e.opportunity is undefined]. Can somebody help me with this issue? Controller: import { ...
  • 13
0 votes
1 answer
77 views

Field Integrity Exception occures when importing library in js controller

I'm trying to import pdf.js to my controller. I've created a static resource called "pdf" and attached pdf.js file to it. Then I'm trying to import that with ES6 import keyword but when I ...
user avatar
-1 votes
1 answer
137 views

Pass multiple parameters from jscontroller to jshelper

I'm trying to filter the outcome of my code. Essentially, I have two dropdown menus where I pick values -- user and state. I have no problem working with a single value (user). But can't figure out ...
  • 29
0 votes
0 answers
1k views

How do I filter data related to selected field box in my lightning data table in LWC

Hello Guys._ Guys, I have an issue with my lightning datatable Current table The problem is when I want to show the data with the current broker selected, for example, if I select "Accurate ...
0 votes
1 answer
326 views

How do I append something to a string until last character?

I'm asking how to append 3 types of strings (initial, middle and final) to each character of an input string example: "hello" -> I want to have: initialAppend+H+middleAppend+E+...
0 votes
0 answers
321 views

Guest use receive error No profiling information for SOQL operations

Guest user receives an error after pressing redirect button in VFP 14:55:47.2 (40002254)|CODE_UNIT_FINISHED|VF: /apex/dossierattachmentsform 14:55:47.2 (40024393)|EXECUTION_FINISHED 14:55:47.43 (...
  • 21
0 votes
0 answers
34 views

field_integrity_exception exception while saving aura controller

Got an issue while saving controller got from trailhead the error states field_integrity_exception [Failed to save helloMessageInteractiveController.js: null: Source] the code is : ( { ...
1 vote
0 answers
40 views

How to open and close a visualForce page with ba related list?

So I am trying to create a VF page where it will be easy to manage multiples records of a related list at a time. My problems are: I don't know how to launch the page from a new button on the related ...
  • 109
0 votes
0 answers
101 views

Content is getting truncated when rendered as PDF

I have a query like i am generating a pdf file in which all the content notes will be displayed.I found an issue like content of contentnotes is getting truncated when pdf file is generated.Please let ...
  • 3
-2 votes
1 answer
3k views

Pass variable from LWC to apex controller [closed]

Not sure of the syntax to pass parameters from lwc javascript to my apex controller. js import createCustomer from '@salesforce/apex/HttpCallout.createStripeCustomer'; export default class ...
  • 563
-2 votes
1 answer
78 views

List index out of bounds: 0 Error is in expression '{!saveAndSend}' in component <apex:commandButton> in page createorderpdf: Class.CreateOrderPDF [closed]

Please help me on this. <apex:page controller="CreateOrderPDFController"> <apex:slds /> <html> <head> </head> <body style=&...
0 votes
1 answer
18 views

Modify string value in soql list and add back to list

I have a VFP which functions as a CSV download. In my controller I return a simple SOQL list from a custom Customer object. I need to modify the Name being returned to remove all commas and then add ...
  • 41
0 votes
0 answers
16 views

How to write test for this controller [duplicate]

I'm new with Apex and controller. I have Apex controller that I don't know how to write test for. It's very simple controller. I have 2 object: Asset_Name__c, Cash_Outlay__c. The Cash_Outlay__c object ...
-1 votes
1 answer
339 views

Code coverage at for loop does not cover code inside loop

Why is my apex test not getting the material inside the for loop? I have test data, and the method gets called. I just don't have coverage for anything inside the for loops as seen below. I included ...
  • 41
0 votes
1 answer
28 views

VFP unknown property integer.optdesc [duplicate]

I included snippets of desired results, controller, and VFP below. I am trying to get to the optdesc and udcdesc values. When I try using !opt.optdesc it gives unknown property integer.optdesc. ...
  • 41
0 votes
1 answer
101 views

Unknown property attempting to access elements in map with apex repeat

Snippet from the controller and map sample data is below. I am having issue getting to the elements within the map using apex repeat. I thought I would be able to do {!getAllOptions[tab].tabname} but ...
  • 41
0 votes
0 answers
43 views

How to send data like list of ids from one vf page to another without using set parameters in page reference

I have created 2 vf pages and using 2 standard controller and a single extension class. The Ids are added from the 1st vf page but when the sencond Vf page is opened then the variable loses the data ...
0 votes
0 answers
76 views

VFP group header from map

Here is the inner/wrapper class and the VFP. I am currently getting this display where the Product_Group__c repeats for every code. I want to display the group once and repeat all codes and values ...
  • 41
0 votes
2 answers
193 views

attempt to de-reference null object when using maps to build parent-child relationship for visualforce page

Products Products__c Name Label Data Type Sample Data Sample Data 2 Sample Data 3 PDC PDC__c Text ACA ACG TBC PDC Desc PDC_Desc__c Text Tire Size Rim / Wheel Disc Size Type of Toolbox Value Desc ...
  • 41
0 votes
1 answer
39 views

Modify AggregateResult List value to take substring of it for displaying on vfp

**solved: I was able to return them as sObject instead of list since I know I will always receive a single value. I was then able to use right function to take my substring. Below is my controller I ...
  • 41

1
2 3 4 5
28