New answers tagged

1

If you want a controller property to be accessible in your VisualForce Page, it needs a getter. Typically, you would declare it thus: public String link { get; private set; } Alternatively, you can add this method: public String getLink() { return link; }


1

While errors from Salesforce can be very cryptic, this one is pretty easy to understand. In the code you've provided, you only define one constructor public APTS_BulkOrderBatchNew(ApexPages.StandardSetController controller) It takes an ApexPages.StandardSetController In your test code, you try to run ApexPages.StandardController sc = new ApexPages....


0

Can you have it all be part of 1 page, broken into 3 sections/s? where each of the 3 sections appear/hide based on user's clicking the Next/Previous buttons?


0

window.open() function takes 3 parameters window.open(url, windowName, [windowFeatures]); try this <input value=" Test Page " class="btn" title="TestPage" name="TestPage" onclick="window.open('/apex/TestPage?id={!vfpage1.Id}&retURL=%2Fapex%TestPage%3Fid%3D{!TestPage.Id}%26sfdc.override%3D1','TestPage','resizable=yes');" type="button" />


0

You can check event.target.files[0].size to determine the file's size: function checkIfEmpty(event){ alert(event.target.files[0].size); } Note that in Visualforce, id attributes are "mangled" to be universally unique within the page. This is why your document.getElementById call fails to find the element. Also, the onchange handler should match the ...


-1

To identify the element from JS you have to navigate through your structure, from the root component. It will be easier for you if you put id's in all your parent component. It would be something like: document.getElementById('{!$Component.ApexBlockSectionItemID.inputfile}'); In regards to iterating through the items that your for-loop is creating, maybe ...


2

You have a comma missing in the Javascript code after the container Try the below code, <apex:page standardController="Job_Description__c" extensions="JobDescription"> <apex:includeLightning/> <div id="container"></div> <apex:form > <div style="text-align: center"> <apex:commandButton styleClass="cButtons"...


0

Please remove following lines of code , it will work csv += formatRows($headers.map(grabRow)); csv += rowDelim;


0

here is one workaround for this issue. Go to the Session Setting, add the base domain of your org into the white-list domain, that should solve the problem. For example, the base domain should be something like this: https://yourdomainname.my.salesforce.com for classic https://yourdomainname.lightning.force.com for lightning Good luck~


1

Sorry, I went through your question very quickly earlier today and responded to a different requirement. If you want only significant decimal values to show and remove trailing 0s, you have to mask your field as follows: <apex:outputText value="{0, number, ###,###,###.##}"> <apex:param value="{!row.Opportunity.AnnualPremiumGross__c}" /> </...


1

Generally the styling is quite strict on renderAs="pdf". Not sure why the behavior is different in PDF, UI can be achieved by having a span inside list item and style the span. <ul> <li> <span style="padding-left: 10px;"> Text entry </span> </li> <li> <span style="padding-...


2

The following URL seems to works <svg aria-hidden="true" class="slds-icon"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{!URLFOR($Asset.SLDS, 'assets/icons/action-sprite/svg/symbols.svg#description')}"></use> </svg>


0

For the version to be updated, you would need to log a bug with Salesforce. To remove this script entirely, do not use rerender on any element. This is what triggers the inclusion of this script.


0

I solved the problem overriding the standard save method in my controller extension. Visualforce code: <apex:page standardController="Contact" extensions="ContactControllerExtension" recordSetVar="contacts" lightningStylesheets="true"> <apex:pageBlock > <apex:form > <div style="margin-bottom: 15px;"> &...


0

As this is basic setup UI I went for: private PageReference addJobsMessages(PageReference pr) { ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO, '' + 'Open Apex Jobs page in a new tab' + ' in <a href="/apexpages/setup/listAsyncApexJobs.apexp" target="_blank">Classic</a>' + ' or in <a href="/...


0

The url attributes must be suffixed c__ as per the documentation of lightning:isUrlAddressable


0

This is odd, and I had to struggle with this the first time I used the lightning:isUrlAddressable interface. It turns out that the component name and any URL attributes must be prefixed with c__ Your URL should be /lightning/cmp/c__ChageCaseStatus?c__recordId={!Case.Id} or /lightning/cmp/c__ChageCaseStatus


0

Yes, you can build a user interface which is viewed and updated by many people with real time UI updates. I would create a solution using the following metadata: A few custom objects to store data about games, players, stories, and scores. Platform events for the types of events which occur during a planning poker game such as the game beginning, a vote is ...


0

You're binding the wrong property. Your commented-out <apex:selectOptions> is where your ObjectItems binding belongs: the value binding of that component should be connected to a List<SelectOption>. <apex:outputlabel value="Object Name"/> <apex:selectList id="option" value="{!ObjectItems}"> <!-- <apex:...


0

Please check this code:For exaplaining example taken account object has example and Type (Dropdown) <apex:page controller="getObjectOptions"> <apex:form > <apex:pageBlock > <apex:outputlabel value="Object Name"/> <apex:selectList size="1" > <apex:selectOptions value="{!ObjectItems}"/> ...


0

If you want to be able to use apex:inputField and apex:outputField in your page, you need your controller to expose an SObject into which you can store those values, as stated in sfwizard's answer. You don't have to switch to using apex:inputText if you simply add appropriate SObjects in your controller, like: class MyController { public Contact ...


0

<apex:inputField can be used on field references only. For example <apex:inputField value="{!contact.FirstName}" or <apex:inputField value="{!objectInstance.FirstName}". If you are just referring some variable defined in your controller, use <apex:inputtext value="{!firstName}"


0

An apex loop will not help you here although if you ever need a loop in VF, you need to use the <script> label to do the loop in javascript. Because your class has a standardController you only have one record to work with - you should look into StandardSetController here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/...


0

Javascript is case sensitive. A property "Contact" is not the same as property "contact". Access your property with console.log('Working2***'+usrResult.Contact.Account.Name); Your first console output gives you the correct cases for the properties.


1

In addition to @SwisherSweet answer, the following will also generate this error: User has Run Flows permission (as Flow User, in Profile, or Permission Set) The Flow is configured so as to override default behavior as shown below The running user has not been granted permission to run the specific Flow (via Profile or Permission Set)


0

From apex you can look at this documentation to help you redirect back to the account page https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_system_pagereference.htm. From the visualforce if you want to use URLFOR Function you have the accountid already you have account as your standard controller. Just make sure you use this ...


1

The field logic should be as follows, just need to use the commented code during the selectOption assignment. public List<SelectOption> getObjectFields() { Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject); Map<String, Schema.SObjectField> ...


0

Problem in below line of your code: <apex:outputText label="Id" value="{!t.Subject}"/> Please check below code: <apex:page standardController="Account" extensions="myControllerExtensionss"> <apex:pageBlock title="Related Activities"> <apex:pageBlockSection title="Activity" collapsible="false"> <apex:pageBlockTable value=...


1

apex:variable is not supported in iterators. The documentation states this explicitly: Note: <apex:variable> does not support reassignment inside of an iteration component, such as <apex:dataTable> or <apex:repeat>. The result of doing so, e.g., incrementing the <apex:variable> as a counter, is unsupported and undefined. Sometimes ...


0

The main problem you have has to do with these few lines of code: public List<Product_Table__c> Products { get; set; } public List<Product_Table__c> getProducts() { return (List<Product_Table__c>)stCon.getRecords(); } When you have both a property and a get/set method, the property takes precedence. This means that you're not actually ...


1

@sfdcfox is correct there is no way to get the page language from the page the way you have it set up, because its not a parameter. You can however dynamically set the page language by passing in the parameter. This question addresses this Assign language Value dynamically in Visualforce page


0

The language attribute isn't a "page parameter" (those are strictly the values found in the URL after the ?). As far as I'm aware, there's no way to get this information from the page. Similarly, there's no way to detect most of the other settings, such as determining if the page is being rendered as a PDF.


0

In Salesforce Classic, you cannot conditionally render page layout components as such - not in the way that you can conditionally render Lightning components on a record page. You also cannot react to edit events on the standard page layout "live", as the user works. Your page would only be rendered after the user saves. You can implement the entire page ...


0

We can use UI API to get picklist values based on record type id. Use the below javascript code in Visualforce page. uiApi.getSObject("Contract").getPicklistValuesPerRecordType("PicklistfieldAPIName", "recordTypeId", function(err, res) { if (err) return; optionscontrats = JSON.parse(res).values; ...


1

The basic query would be: SELECT Id FROM Contact WHERE Id IN (SELECT ConvertedContactId FROM Lead)


0

This should work: MSSPageController.updateHopscotch( function(result, event){ alert(result); flag = result; console.log('Log here===='+result); } );


2

it is expected behavior. please check documentation Navigation Experience Lightning Experience, Lightning Communities, Salesforce Mobile App it will not work for Lightning Out (embedded in VF page)


1

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 need to come up with a different approach.


0

You can use this function : numericValidation(); for onkeydown event elem : pass the whole element wholeLen : number of allowed whole numbers dcmlLen : number of allowed decimal numbers This function will block out all text characters and will only allow number inputs. For example, if you would like to only allow numbers with 2 whole numbers and 3 ...


0

For a new record, the account acc is null. This will create problems. Initialize the variable: if(String.isNotBlank(accId)) { acc = [SELECT Id, Name, Beachhead_Attributes__c, Pain_points_with_alternative__c, Benefit_Sought__c, Estimated_Budget__c, Estimated_Campaign_Timing__c, Prospect_s_target_audience_s__c, Exposure_to_TV_Ad__c,Attendees__c, ...


0

We Can pass recordId in directly instead of EnrId $Lightning.createComponent("c:enrollment_5", {recordId : enrollId}, "lightning",


0

check this snippet try to modify according your requirement. contactObject = null; contactObject = (Contact)Contact.sObjectType.newSObject(RecordTypeId,true); //you will get the Default values, only if you have set the default values, for each picklist field under each recordType. System.debug('contactObject:'+contactObject.PicklistField__c);


0

The other answer is partially correct, but I don't agree with the entire prescription and elements of it are incorrect. The root cause is that your variables are not defined. public String Subject{get;set;} Public String Body{get;set;} Public String attname{get;set;} Public blob attbody{get;set;} These are all null. You're not populating them here, and if ...


0

Use Database.Stateful interface, and then send the email in the batch's Finish method. Notice two things here : 1.Database.statefull Interface 2. declared global variable instead of local scope Please check the rough Skeleton: //use database.statefull Interface global class AttachmentEmail implements DataBase....


1

Performance testing is not allowed without advanced notice. Sometimes changes and customizations to your Salesforce implementation impact performance. Before going into production, it is wise to run sandbox performance tests, please read Methods of Locating and Testing for Performance Issues. Salesforce is a multi-tenant environment. If you decide to test,...


0

{!URLFOR($Action.CustomObject__c.List, $ObjectType.CustomObject)} should be corrected to {!URLFOR($Action.CustomObject__c.List, $ObjectType.CustomObject__c)} Also, According to docs:- List views are visible to your community users with Customer Community Plus, Partner Community, Lightning Platform Starter, and Lightning Platform Plus licenses, if ...


0

There are three steps to add Aura components to a Visualforce page. Add the Lightning Components for Visualforce JavaScript library to your Visualforce page using the <apex:includeLightning/> component. Create and reference a Lightning app that declares your component dependencies. Write a JavaScript function that creates the component on the page ...


2

You can embeed the vf page inside lightning component using IFrame and pass twitter handle as a url parameter and update the href attribute in js of VF page. Example VF Page <apex:page showHeader="false"> <apex:includeScript value="{!$Resource.widget}"/> <a class="twitter-timeline" id="twitterFeedContainer" data-link-color="#19CF86"...


-1

After almost 2 years I am working again on VF page : You can use the below code to assign fieldset dynamically : public void addFieldsForFieldSet(ApexPages.StandardController stdController){ Map<String, Schema.Fieldset> fieldsets = Schema.SObjectType.Case.fieldSets.getMap(); for(Schema.FieldSetMember fst : fieldsets.get('recordTypeName')....


0

For messages to appear on a VF page, you have designate an area for them to appear. You do so with apex:pageMessages: <apex:page standardController="License_Request__c" > <apex:pageMessage summary="Please refresh page after pressing get license" severity="info" strength="3" /> <apex:pageMessages /> </apex:page>


Top 50 recent answers are included