New answers tagged

1 vote

Unknown property 'VisualforceArrayList.EHS_Task__c'

public List<EHS_Pre_Job_Brief__c> getEHS{get;set;} This is a list of items. You need to access the zeroth index: <input type="text" name="task" id="task" class=&...
  • 444k
1 vote

' rendering as \' in VF page rendered as PDF

The JSENCODE is what's causing this. You want to use HTMLENCODE instead. You only use JSENCODE if the value is included directly in a script tag. <script> var x = {!JSENCODE(config)}; </...
  • 444k
0 votes

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

Copy paste rich text value from sandbox to production does not work properly. I believe this is an API Version issue cause i am copying from sandbox to production where versions are different. And ...
  • 444k
0 votes
Accepted

Invoke lightning web component from vf page on apex:command button click

I was able to achieve this by using a little hack. <script> function openLwc(){ window.open('/lightning/n/lwccmponvf') } </script> I am directly calling this function from ...
0 votes
Accepted

Include aura component (paginator) in visualforce page

You can Use Lightning Components in Visualforce Pages with the techniques outlined in the documentation. First, you create a dependency app (Lightning App): <aura:application access="GLOBAL&...
  • 444k
0 votes

Display a Qr code ( an image formula field) in a VisualForce page

I had the similar issue and solved based on this: https://developer.salesforce.com/forums/?id=9060G000000XatcQAC HTML: <apex:image value="{!qrCodeUrl}"/> Apex ControllerExtension: ...
0 votes
Accepted

Can I conditionally add css in <style> tag on a visualforce page?

There's several ways you can do this. For example, you can use apex:outputText, as in the following example: <apex:outputText rendered="{!someCondition}"> @page{ background-image:...
  • 444k
-1 votes

How to control the size of the background image in visualforce PDF

You could try something similar to this... .the-image { background-image:url('{!URLFOR($Resource.fondosPDF, 'fondo_presupuesto_atelier.jpg')}'); background-color: #cccccc;/* Used if the image is ...
0 votes

Align two Tables side by side - Visualforce

I have done this in the past by putting the tables in a parent table similar to the following... <table width="75%"> <tr> <td width="30%" valign="top"&...
2 votes
Accepted

APEX: How to get Field Label Name using Field API?

Your logic is correct. You just need to pass objectname in OBJAPI and field api name in field. Something like this. Map<String,Schema.SObjectField> mfields = Schema.Account.SObjectType....
1 vote
Accepted

Table in Vf page not getting populated in the order which I selected

StandardSetController.getSelected() does not guarantee any particular order as to the order of selections. You would need to write a query to get the records in the order you want, such as: Set<Id&...
  • 444k
1 vote

LWC icons not rendering in visualforce page or browsers like chrome/edge

You don't have to upload the svg files as static resources. Include <apex:slds /> in a Visualforce page to use Lightning Design System stylesheets in the page as explained in the documentation. ...
  • 13.6k
0 votes

How to render base64 image as pdf using visualforce page?

This will never work until/unless the underlying PDF rendering engine, Flying Saucer, is updated to included support for this feature. As far as I'm aware, there's no plans to include a more capable ...
  • 444k
2 votes
Accepted

Input on Visual force page form with Controller

You just need to read a parameter from the URL: String accountId = ApexPages.currentPage().getParameters().get('id'); Which you then place into the URL: /apex/myPage?id=0010400001234ABEEY To make it ...
  • 444k
0 votes

ListView custom button does not update pulled in selected ids

The problem is that in this method declineFileFeedRecords you're not actually updating the records. Please, add update selectedFileFeeds; before return statement and put this whole code to ...
3 votes
Accepted

List has no rows for assignment in visualforce controller

PageReference's getContent and getContentAsPDF are treated as callouts. In other words, they happen as a separate, synchronous transaction. As such, a Visualforce page called this way won't be able to ...
  • 444k
1 vote

how to pass a list of ids to screen flow via pageReference url

Please replace your Apex code with this Line Your Code String urlParams = '?ids=' + String.join(getFulfillmentOrdersId(records), '&ids='); New Code(Need to be Replaced) String urlParams = '?ids=' ...
  • 526
2 votes

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

You can use JavaScript for this: <apex:commandButton value="Save" action="{!SaveMethod}" onclick="this.style.display='none'"/> If you want to reenable the ...
  • 444k
2 votes
Accepted

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

Use a rendered condition for apex:commandButton. VF page: <apex:commandButton rendered="{!NOT(hideSave)}" value="Save" action="{!SaveMethod}"/> Controller: ...
  • 806
0 votes

Stop blank page being created (because of page break setting) at end of visualforce rendered as pdf

I would like to contribute the following response because the original problem was not what I thought it was. I assumed a completely blank extra page was being created after each page break, but that ...
1 vote

Need more info regarding release update 'Validate Getter and Setter Access Modifier Enforcement During Visualforce Expression Language Parsing'

This release update has been postponed indefinitely and is not enforced in its present form. https://help.salesforce.com/s/articleView?id=release-notes.rn_vf_get_set_access_modifier_ru.htm&type=5&...
0 votes

Access to resources from an unapproved, external host violates the Content Security Policy (CSP)

My initial thought is that the URL is not in canonical form. That means if you have a URL such as: //apex/myPage The browser may interpret it as: https://apex/myPage Similarly, undefined means that ...
  • 444k
3 votes
Accepted

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

You can't edit the Name field; it is a compound field that uses FirstName, MiddleName (if enabled), Last Name, and Suffix. You need to edit the individual fields, instead. <apex:column headerValue=&...
  • 444k
1 vote

Users with same profile and role cannot view a visualforce

The question isn't that specific but from the sounds of things, it seems that you need to grant Visualforce page access to the user. The simpliest way to do this would be to add this via the Profile (...
1 vote

VF page with 2 search conditions

The value of the action attribute should be the Apex controller method you wish to call. Here, <apex:commandButton value="Search records" action="{!searchKey1} AND {!searchKey2} &...
  • 88.1k
2 votes
Accepted

Delete failed. First exception on row 0 with id 0035i000008hdheAAA; first error: DELETE_FAILED

The error in your image says the following: "Your attempt to delete Ms Lauren Boyle could not be completed because it is associated with the following cases 00001024, 00001025" you can't ...
  • 58
0 votes

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

What you are asking for is not possible.
  • 50.5k
1 vote
Accepted

System.EmailException: SendEmail failed. First exception on row 0; first error: LIMIT_EXCEEDED, System.LimitException: Too many future calls: 1: []

I guess: Production has a trigger on EmailMessage, which does not exist in your dev environment. EmailMessageTrigger fires @future method. As you can see in the image below, @future cannot be executed ...
  • 1,311
0 votes

Displaying Related Documents OF A Custom Object in VisualForce Page Salesforce

According to the Salesforce document, the apex:relatedList can only be used for records related with a lookup or master-detail relationship. I am thinking in your situation you would want to use apex:...
0 votes
Accepted

Log users out of the community site?

To logout a user you can write following code. public pagereference logout(){ //perform Business logic here PageReference pageRef = new PageReference('/default/secur/logout.jsp'); ...
  • 2,402
0 votes

Visualforce Page - Render Rich Text Area(32768)

I have had this problem. This is the line I used to fix it. <apex:outputText escape="false" style="font-weight:normal; white-space:pre; padding-bottom:5px" value="{!...
2 votes
Accepted

Generate to Excel using JSON with Select List

I update my code like this <apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel"> <apex:tab label="Validate" name="validate&...
0 votes

Redirect from visualforce apex controller to lightning page

When you look at lightning-navigation, you'll see it's only supported in: Lightning Experience, Lightning Communities, Salesforce Mobile App Notably, it is not supported in Lightning Out. You'll ...
  • 13.9k

Top 50 recent answers are included