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
1answer
39 views

How To add new Contact To existing Account?

Created A component to Create a New Contact And Added it to Account Page layout. now i want to Connect That new contact to Account in which we have. Apex public class CreateContact_Ctrl { @AuraEnabled ...
0
votes
1answer
41 views

want to navigate to detail page

Hi yal i am New on salesforce want to navigate to a contact Detail page through Button.How to pass parameter ? How can i do please help. Apex Class:- public class ShowContactInCard { @AuraEnabled ...
0
votes
0answers
24 views

Unable to pass parameter to apex controller via JS

I already had a working apex function with various string parameters that I pass via the JS helper. I just added a new String parameter "reasonPick" to the apex function however when I try ...
0
votes
0answers
27 views

Custom field are not displayed in the Lwc

I'm trying to pass a list of assets to the lwc from the controller but when reviewing the data, only the values of the standard fields are arriving, the custom fields do not appear This is my ...
0
votes
1answer
23 views

Visualforce rendered if list is empty

I'd like to render a VF component if a list is empty, but the VF page is giving an error of "Unknown property 'CheckOpps.opportunity'. How to correct this error? I am building the list in a ...
0
votes
1answer
19 views

Fire 2 events at a time

I'd like to fire 2 events at a time but it only executes the first .fire() method. I've got 2 events for showing and hiding of multiple lightning components. Can anyone suggest if how can I implement ...
1
vote
1answer
61 views

common.apex.runtime.impl.ExecutionException: Invalid id: [] How to remove [] parenthesis when LWC sends List of Ids to controller class method?

I have created Custom List Button on Case object. That button calls VF page and then VF page calls LWC which updates the record. Once Record is updated I want to navigate back to Current List View. I ...
0
votes
0answers
20 views

How to Navigate to Custom List View after updating multiple records from List View?

Requirement: On Case Object Custom List View(Queue), we have Accept button. When I Click on Accept Button, it transfer Record Ownership to Current User and it stays on the same list view similarly I ...
0
votes
1answer
18 views

Need to get value for reference field instead of ID's

Below is my code where I am describing all the fields of selected object. Instead of fetching ID for reference fields I need to fetch values for example I in case of account Id I want to fetch account ...
0
votes
2answers
31 views

Need to change field label of ID

I have a requirement where I am fetching fields of SObject and displaying them on UI. I want to change the label of ID to ID(Master Record). Please help me how to do it. Below I'm attaching my UI snip ...
0
votes
0answers
17 views

Prevent automatic field update on a record when related record is update

I have created a button on Community allowing a client to subscribe or unsubscribe to an article in our client portal. When the client clicks subscribe A record is created in Salesforce in my custom ...
0
votes
2answers
23 views

Problems with building a custom controller in Salesforce

This is my first time having built a custom controller, and I in a revolving door of errors: This is the code with which I begin, and this DOES work: apex: <apex:page controller="...
0
votes
0answers
32 views

Update records using input data in aura

I have an aura component with records <section class="slds-card__body"> <div id="list" class="row"> <table class="slds-table slds-...
0
votes
0answers
10 views

Service Console Tab label showing “Loading…” i VFP launch from button

I have a visualforce page that is launched from a button on in a service console app. The page is rendered as a pdf and opens in a new tab, but that new tab forever stays as loading, confusing end ...
0
votes
1answer
17 views

Problem with aura and JS controller

I have a little problem. I have a simple program that gets a value from picklist , and using this value my program must show all values from the database Thats my code COMPONENT <aura:attribute ...
0
votes
1answer
14 views

How to populate additional Contact field into object

Good day, I have 2 contact fields on my Case Object, they both pull different contacts. How do I reference the second contact field in my controller & VF page? Assistance will be appreciated..
0
votes
1answer
16 views

Roll up field not displaying whole numbers in Custom Controller

I have a rollup field on the Quote object. When I access that value in my VF page controller, I'm seeing its value getting truncated there. Because of this when I'm seeing less amount on my VF page. ...
0
votes
0answers
23 views

How to get data of each row in apex:repeat to pass them to controller

I am trying to build a sell sheet which comes in two VF pages. In the first page the products will be displayed based on the category selected. The products are shown in an apex:repeat. There is a ...
0
votes
1answer
27 views

save failing due to WhoId when trying to make custom component work on Account object

I have this custom component built on Contact that creates a Task record. The goal is to modify these functionalities to also work on Lead and Account objects. Had no issues making it work fully on ...
0
votes
0answers
37 views

How to modify the CommunitiesSelfRegController to check if the contact exists in Salesforce?

I have a community portal where we want to allow external users to self register. As you might know, a controller called CommunitiesSelfRegController does this. The external users needs to give their ...
0
votes
1answer
33 views

Need to compare two list and remove item from first list if second list contains same item

I have a requirement where I need to remove Account from sObjectList as my tempSOjectList contains account. Below is my code when I try to use sObjectList.remove(s) it throws error incorrect signature....
0
votes
1answer
41 views

Error: Method does not exist or incorrect signature: void getRecord() from the type VFAccount

I am trying to create a custom controller and extension to create account records. But I am stuck with this error I am facing. I have tried many other tips to make this work and but no avail. This is ...
0
votes
2answers
43 views

LWC - How to expand only clicked value on a table

I have a table of values of a custom object, like this : When I click the first line (Value1, Value 11 or Value 111) I want to expand ONLY the first line to show values related to this line that are ...
1
vote
1answer
28 views

Unknown Constructor error for extension controller

Hi im trying to use an extension controller for some kind of calculation in my vs page and getting error about the constructor: Unknown constructor... any help with that? code public with sharing ...
1
vote
1answer
38 views

No Save and Controller Extensions throw Unknown Property Errors

For clarity, and as I accepted an answer in the last question, I am posting a new question for additional help with new issues. The last question can be reviewed here. Here are my new issues: When ...
0
votes
2answers
76 views

Unknown Property Error on VF Main Extension

UPDATE 12/29/2020: For clarity, and as I accepted an answer here, I am posting a new question for additional help with new issues. The new question can be reviewed here. UPDATE: I am trying to switch ...
0
votes
1answer
27 views

How to add hasRecordId into my existing lightning component code?

I am pretty new to coding and need some help on how to add hasRecordId into my existing JS controller and Apex code. I need my Opportunity Id to automatically populate the recordId that the lightning ...
0
votes
2answers
33 views

My VF page didn't load correctly

My vf page doesn't load correctly. I have to create a button just to load the contents of it. can anyone check it for me? here's the code: VF PAGE: <apex:page controller="NightFlexList2Con&...
1
vote
0answers
46 views

First error: No content to map to Object due to end of input

Below is my batch class which gets data from external systeglobal class LogClass implements Database.Batchable<Integer>,Database.AllowsCallouts, Database.Stateful { global Iterable<Integer&...
1
vote
1answer
54 views

Issue with Test Class for REST API [duplicate]

I have an apex class which fetches and upserts data from external source to Salesforce. Below is the batch class: global class PolicyCalloutBatchClass implements Database.Batchable<Integer>,...
0
votes
0answers
93 views

Error: System.NullPointerException: Argument cannot be null

I have a requirement where the data from external system is fetched and upserted back in Salesforce. below is my apex class: public class RESTClass { @future(callout=true) public static ...
1
vote
1answer
45 views

Error: System.JSONException: No content to map to Object due to end of input

I have a requirement where the data from external system is fetched and upserted back in Salesforce. below is my apex class: public class RESTClass { @future(callout=true) public static ...
1
vote
1answer
141 views

Upsert records after parsing JSON response

I have a requirement to upsert Policy records using JSON response obtained from external system. below is my apex code: HttpRequest req = new HttpRequest(); req.setMethod('GET'); req.setTimeout(...
1
vote
1answer
55 views

Force.com Site: Read access denied for Custom_Object__c, but works fine in sandbox

I have a basic visualforce page that uses the standard controller for an object (Custom_Object__c). The object is a detail record, with the master being another custom object (Parent_Object__c). The ...
0
votes
1answer
24 views

Conditional not rendering output section

I have a pageblockSection I want to render if a conditional evaluates to true. This is my VF code <apex:page standardController="Intake__c" extensions="IntakeExtension,...
0
votes
1answer
70 views

Create record from JSON response recieved from external system [closed]

I have a json response which I got from external system using its endpoint. Now I need to create account records in Salesforce using that response. Below is my Rest Callout code: String jsonbody = '{ ...
0
votes
1answer
154 views

Math.max returns NaN in case of null values

I am a new one in javascript and there is a case. I have a controller with many input values and I want to get the maximum value of them. I use var getMax = Math.max(field1__c,field2__c,field3__c,.....
1
vote
1answer
457 views

Parse comma separated String to List in LWC

I'm building an LWC to be used in Record Page and Community, a custom related records list component, that shows formula fields properly formatted (rich-text formatted), so it uses targetConfigs ...
1
vote
0answers
26 views

Pass value to apex controller using apex action support

Im trying to pass values to apex controller from vf page but values are not passing. could you guys please check where im going wrong. VF PAGE <apex:repeat value="{!am.names}" var="n&...
0
votes
1answer
66 views

reRender Page Block Sections Based on Selected Value of a selectList

I am creating a Visualforce page and I have a section where I want to add in a Select List with three values and based on the value that is selected I want it to display a specific Page Block Section ...
0
votes
1answer
32 views

How can I pass a parameter into a method inside an if statement within a visualforce page?

I have the following Controller and Visualforce(VF) page where I need to conditionally display a different value based on what is passed into a method. Question How can I pass a parameter into a ...
0
votes
0answers
60 views

Test Class for system.runas(user) not working for UserInfo.getUserId Coverage

Im stuck at 52% coverage of a vf controller that queries and displays timecards__c records of UserInfo.getUserId in a table. What is basically not getting covered is the if else statements after the ...
0
votes
1answer
28 views

Issue while looping through child records

I have a requirement to check for Role_Name__c on Account_Role__c object which is a child of Policy__c object. Now, if any child records have Original or Duplicate as value in Role_Name__c, a new ...
0
votes
2answers
89 views

doInit function in LWC

I'm trying to update the record using the recordId passed from aura quick action, then lwc component will update the record. However when I try the following: called the connectedCallback but the ...
0
votes
2answers
44 views

Issue with after update trigger

I have a trigger which creates new Cust_Alert_record when Policy__c record is updated. Below is my trigger: trigger AlertTextforContact on Policy__c (after update) { List<Cust_Alert__c> ...
1
vote
1answer
212 views

How can I add/remove the “checked” attribute via LWC controller data?

Brief context: I have a page with n number of rows using for:each={rows} for:item="row". Each row has its own checkbox. There is a filtering feature that (by rerendering the with a getter) ...
0
votes
1answer
40 views

Issue while parsing JSON in Test Class

Below is my test method: static testMethod void callbackdateTomorrow() { Date currentDate; CurrentDate = date.today(); System.RestContext.request = new RestRequest(); ...
0
votes
1answer
17 views

Show Apex Errors on Visualforce Page

I have a VF page with a custom controller that allows a user to enter multiple records for a custom object using a Type picklist field. I also have a trigger that populates those values to the parent ...
0
votes
1answer
32 views

Show Trigger Error on VF Page

I have a VF page and custom controller on a custom object related to the Contact object. There is also a trigger on the custom object that prevents duplicate entries. All works fine, however, when a ...
0
votes
1answer
48 views

Custom Controller Question

I have a simple Visualforce page with 3 fields that launches from a controller method related to another VF page. The page loads properly using the controller below, but I am trying to pre-populate ...

1
2 3 4 5
27