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
0 answers
26 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 (...
user avatar
  • 17
0 votes
0 answers
10 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 : ( { ...
user avatar
1 vote
0 answers
19 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 ...
user avatar
  • 43
0 votes
0 answers
17 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 ...
user avatar
  • 1
-2 votes
1 answer
67 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 ...
user avatar
  • 439
-2 votes
1 answer
25 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=&...
user avatar
0 votes
1 answer
13 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 ...
user avatar
  • 29
0 votes
0 answers
15 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 ...
user avatar
-1 votes
1 answer
44 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 ...
user avatar
  • 29
0 votes
1 answer
23 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. ...
user avatar
  • 29
0 votes
1 answer
43 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 ...
user avatar
  • 29
0 votes
0 answers
18 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 ...
user avatar
0 votes
0 answers
67 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 ...
user avatar
  • 29
0 votes
2 answers
57 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 ...
user avatar
  • 29
0 votes
1 answer
37 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 ...
user avatar
  • 29
0 votes
1 answer
18 views

Expand inner soql array and return regular list in controller for visualforce page

Here is my controller. I want to expand the array so that the fields are accessible in my vfp. When I try referencing any fields from the inner query in my vfp I receive "Error evaluating dynamic ...
user avatar
  • 29
0 votes
1 answer
45 views

Argument cannot be null when testing controller that displays some dates on a lightning page

Controller: public with sharing class DatesController { public String vehicleId {get;set;} public List<AggregateResult> AggregateResultList{get;set;} public List<...
user avatar
  • 29
0 votes
1 answer
37 views

Use a custom controller in Visualforce template

I am trying to run an email template from the Contract object, but in the email (or an attached PDF) print a list of related cases and specified fields for the cases. I've managed to do this ...
user avatar
  • 17
0 votes
1 answer
58 views

Problem with LWC that should show a list of answers for each Question

I made an LWC that should show a list of question with some answers for each question under the Campaign Member, but after managing to retrieve the questions and show them in the HTML, I don't manage ...
user avatar
0 votes
0 answers
71 views

Redirect Visualforce page to List view

I have created a list view button that calls Visualforce page with controller that creates some records based on multiple Selection of records at the list view , after that I want to redirect to a new ...
user avatar
  • 55
0 votes
1 answer
34 views

List won't update after inserting related list

I have a list view button that creates related sales order records based on the selected service contracts and their values. The creation of the sales orders works, but when I try to update those same ...
user avatar
  • 47
1 vote
0 answers
25 views

Pagereference Return is getting cached and not rendering latest UI until refresh

I have a requirement where we perform "Mass delete" for records in one of the related list (Custom object called Recipient__c) from the parent object (Parent Object called ...
user avatar
  • 31
0 votes
1 answer
56 views

Apex Test Class Fetching Article Details

I need help with writing an apex test class for a class that fetches article titles and article descriptions. Class for example: global class FetchingArticleDetails{ global List<(API name of ...
user avatar
  • 3
1 vote
1 answer
63 views

Using a utility method in aura controller

I have a common method that is to be shared between 2 aura controller methods. Is there are a way to create a single function and reuse it in both places. Example: MyAuracontroller.js: method1 :...
user avatar
  • 4,521
0 votes
0 answers
13 views

test class for apex class which has wrapper class [duplicate]

public class MyOrderListController { public List<WrapperClass> WrapperList {get; set;} public class WrapperClass{ @AuraEnabled public string PName{get; set;} @...
user avatar
0 votes
0 answers
83 views

Undefined response.getReturnValue

I am trying to change the language of salesforce in Community with a custom component based on a picklist. The Apex class works fine but when I try to test it in Community it returns me an error ...
user avatar
-1 votes
1 answer
63 views

I didn't see my opportunity in visualforce page [closed]

I modified my class with :ApexPages.currentPage().getParameters().get('Id') When I launch my Visualforce page i didn't see records. What can i do? Thank you for your reply!
user avatar
  • 1
1 vote
1 answer
75 views

Switching from @remoteaction to actionFunction due to "Visualforce Remoting Exception: Input too long" error

In very few words, I am hitting some sort of limit with a visualforce remote action, as I get the following error: Visualforce Remoting Exception: Input too long I reached out to Salesforce support, ...
user avatar
  • 305
1 vote
1 answer
108 views

How Do I Override the Standard Controller's Save Action in My Controller Extension?

I am trying to build a controller extension for the Opportunity standard controller. According to documentation and stackexchange I ought to be able to override the Save() action in the controller ...
user avatar
  • 163
0 votes
0 answers
44 views

Visualforce Email Template Help with Conditional Rendering Datatables

I have a component I am trying to display within a Visualforce Email Template. Essentially I need to display 1 of 4 possible outcomes within a datatable depending on if the data were to be returned in ...
user avatar
0 votes
0 answers
42 views

Navigate to a link with apex:command button

I have a <a></a> which downloads the document from salesforce(https://<salesforce_baseurl>/servlet/servlet.FileDownload?file='+ doc.Id). Below is the code for anchor tag. <a href=...
user avatar
0 votes
1 answer
32 views

VF Page not retrieving to the original state after Page refresh

I have a VF page that gets disabled with the click of a button. I want the button 1 it to get enabled back after doing the refresh (browser refresh). Below is my VF page and its controller: <apex:...
user avatar
0 votes
1 answer
33 views

Fetching User Info in Lightning Component

I'm trying to create a Lightning Component to integrate Sendbird into Salesforce by following this guide: https://sendbird.com/developer/tutorials/how-to-integrate-sendbird-with-salesforce I've ...
user avatar
1 vote
0 answers
34 views

Action.setCallback not being executed event tabclosed lightning component

I have an issue where in my action.setCallBack is not being run. When user closes the tab, the component call a function onTabClosed. onTabClosed : function(component, event, helper) { var aCaseId ...
user avatar
0 votes
1 answer
107 views

Query apex controller Where into a string

I am not a developer but I am trying to modify this controller that is available in a component I installed via app exchange. For what i understood the code is just converting this query into a string ...
user avatar
0 votes
0 answers
86 views

I cant able add the map of values into other map when keys are not same

I have - Map<String,Wrapper> mapWrapFloating = new Map<String,Wrapper>(); Map<String,Wrapper> mapWrapFloatingOppLineItems = new Map<String,Wrapper>(); that contains different ...
user avatar
0 votes
1 answer
78 views

Lightning component working alone but not working inside another component

I've created a component to update "Observations__c" value in Account Object. It is working fine, but I need to call it inside another component. But inside another component, it isn't ...
user avatar
0 votes
1 answer
711 views

If I click the button in the Aura Component, I want to go to the Url I want

JS Controller onconfirm : function(component, event) { var windowHref = window.location.href; var url = new URL(windowHref); var recordId = url.searchParams.get("...
user avatar
  • 31
0 votes
1 answer
303 views

Join multiple JSON strings in Apex

I have a requirement to display Accounts-->child Accounts-->Tasks-->Child Tasks in the JSON. Here is my Apex code: List<Account> accountRecordsList = new list<Account>(); List<...
user avatar
0 votes
1 answer
119 views

(Case)controller.getRecord(); - Returning Null in the visualforce page [closed]

I'm trying to get the record that starts a visualforce page but it's returning null. Can anyone point out the problem to me? Visualforce: <apex:page standardController="Case" extensions=&...
user avatar
0 votes
1 answer
49 views

Create record from ModalBox in Community cloud using Aura Component

I have created an Aura component in Community that display a ModalBox allowing to create a record in Salesforce when submitting the info from the modalBox. The problem I have is that when the record ...
user avatar
0 votes
1 answer
93 views

Issue with Sub-query levels in SOQL

I have a requirement to fetch Parent, Child, and Grandchild and Store them as JSON in the same hierarchy. Here is my logic: public List<Parent_Project__c> ProjectRecordsList {get; set;} ...
user avatar
0 votes
1 answer
128 views

Plural Label of Managed Package Object

I have an Object which is deployed using Managed Package in my Org. Here is the object (Name Changed): API name of the custom object is res__Accs__c. Now when I tried to get the plural lable of the ...
user avatar
0 votes
1 answer
73 views

Passing values from Controller to VF Page

I have a requirement to display Account and its child Accounts using Gantt Chart. Here is my Logic: Controller: public with Sharing class Account_Gantt { public Account ParentRecord{get; set;} ...
user avatar
1 vote
1 answer
88 views

Add Child Tasks dynamically in VF page created using DHTMLX Gantt Chart

I have a requirement to show Projects and its related sub tasks using Gantt chart in Salesforce. I have used DHTMLX as my base source. Here is my logic: <apex:page standardController="...
user avatar
1 vote
1 answer
130 views

Commerce Cloud Controller Authentication

I did a controller inside commerce cloud in order to update the order from the external Order Management Service. Then controller inside the Commerce Cloud will receive the order details by a POST ...
user avatar
  • 31
0 votes
2 answers
653 views

Apex Error: Illegal assignment from List<String> to String

I have a requirement to fetch Contact Region from Contact and update the same on User. Here is my logic: list<user> user = [SELECT name,Region__c from User where isactive = true]; Set<...
user avatar
1 vote
1 answer
48 views

Display Custom text in VF Page when field value is null

I have a Gantt Chart which is used to show the Project Timeline. I am using Google Charts to display the Gantt Chart. Below is the VF page: <apex:page standardController="Project__c"> ...
user avatar
0 votes
1 answer
34 views

Cannot get value back in VF page from the controller [closed]

I'm using the code below but I'm not able to get value in controller and also makes blank what I entered in VF page. please check if this code needs correction: VF Page: <apex:InputText label="...
user avatar
0 votes
1 answer
76 views

Fetch only one child record of a parent in soql

I have a requirement to fetch Timecard records that are related to a Project. Below is my query: List <Timecard__c> timecard = [ SELECT ID,Project__c,resource_name__c FROM Timecard__c ...
user avatar

1
2 3 4 5
27