Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
13 votes
Accepted

Easiest way to get a value from a lightning:inputField

Assuming your lightning:inputField tag has the aura:id of firstNameField, for example, you'd get its value with: var firstName = component.find("firstNameField").get("v.value"); In your second ...
Renato Oliveira's user avatar
13 votes
Accepted

Get field-name property on onchage event in lightning web component

event.detail will give you the data sent in event and event.target (or event.currentTarget) will give you the details about the elements. Currently you are looking for attributes on source element so ...
salesforce-sas's user avatar
10 votes

Issue in Finding Difference between Date's in LWC

The event.target.value is a string, not a date. You need to convert the value to date first then you need to subtract it. import { LightningElement, track } from 'lwc'; export default class ...
Rahul Gawale's user avatar
  • 12.2k
8 votes
Accepted

Error: Received exception event aura:systemError from server

The maximum payload for Aura/LWC is 4 MB. Files are uploaded in Base-64 encoded format, which limits the file to about 3 MB in total (minus protocol overhead for calling a server method). Depending on ...
sfdcfox's user avatar
  • 494k
6 votes
Accepted

Is there a Lightning component for inputRichText - with image upload?

There isn't one now, but it looks like one is coming in Summer 18. I just checked in my pre-release org and in v43.0 there is a new component called lightning:insertImageButton that can be used inside ...
Daniel Hoechst's user avatar
6 votes
Accepted

How to clear the filename and value of apex:inputFile

You can pass the element id in the checkFileSize method, and then do your processing then <apex:page controller="FileUploadController"> <apex:inputFile id="inputfile" value="{!newAtt....
Pranay Jaiswal's user avatar
5 votes
Accepted

Uploading from SF to AWS S3: upload works but all files are empty

You should not be setting Content-Encoding. UTF8 is for text, so it'll mess up some bytes in the upload process. Just leave that header out. Edit: I see you decided to base-64 encode your fileBody. ...
sfdcfox's user avatar
  • 494k
5 votes

Input field to accept only numbers and the number can start with 0

Short answer: numbers "cannot" start with 0. Entering something with leading zeros is a valid syntax but these will not be saved. Detailed answer: any input field of type number (be it HTML or ...
POZ's user avatar
  • 4,374
5 votes
Accepted

why validation does not work in my code?

Very painfully, component.find has 3 possible return values: undefined single component component array Always returning an array of 0, 1 or more entries would be more helpful and the addition of a ...
Keith C's user avatar
  • 136k
5 votes

Lightning:input type="date": how to change the date fomat - Summer'18

in Summer 19 SF add new attribute dateStyle for lightning:inpput date and datetime type fields link. in your case dateStyle="short" works for you <lightning:input aura:id="dob" type="date" name="...
sdandamud1's user avatar
  • 2,705
5 votes
Accepted

RecordEditForm: Reset inputfield after successful submit

I guess you can add your lightning:recordEditForm inside the aura:if and reset the flag variable used in aura:if in insaveComplete() method .This will refresh the form.
Rohan Deoskar's user avatar
4 votes
Accepted

What is the best way to mask Visualforce Inputfield?

Assuming you mean you want that particular code on your visualforce pages, you could turn it into an <apex:component>. Your component would just be: <apex:component> <apex:...
IllusiveBrian's user avatar
4 votes
Accepted

Set Two Different Values for the same field in a vf page via controller extension?

I don't think it would be possible with one instance of task. You need to create two separate instance or need to use a list. public Task OldmyTask {get;set;} public Task NewmyTask ...
Tushar Sharma's user avatar
4 votes
Accepted

Problem with ui:inputText and ui:inputNumber : maxlength and restrict some characters

Well with a little bit of code you can achieve this. You need to use maxlength attribute to restrict the length and following approach for number only validation. Have an attribute bound to your ...
Santanu Halder's user avatar
4 votes
Accepted

Visualforce - inputField render as span tag instead of input tag

Ok guys don't mind, the profile was missing the Create permission on the Account object, that's why the Name field was not displaying on the page. Funny enough, other fields were displaying correctly ...
Marco's user avatar
  • 368
4 votes

how to clear value of force inputField in lightning?

After toying with force:inputField a bit, I found the following code to clear it's value. // Clear binded value var contractLine = component.get('v.contractLine'); contractLine.Product__c = null; ...
Charles Naccio's user avatar
4 votes
Accepted

How to increase width of apex:inputfield for case owner field

For lookup fields, the styling will get placed in a <div> wrapper element and not directly on the input itself. What you will have to do is put a styleClass on your field, which will get placed ...
Drew Kennedy's user avatar
4 votes

For what reason there are force:inputField and lightning:inputField if both of them correspond to Lightning Components?

force:inputfield does not have SLDS baked into it .So there is no out of box styling for the inputfield . Apart from that does not work properly .Specially does not work inside aura:iteration and does ...
Mohith Shrivastava's user avatar
4 votes
Accepted

Lightning:input type="date": how to change the date fomat - Summer'18

Updating answer : it need to be done with ui:input <ui:inputDate aura:id="EndDateField" value="" displayDatePicker="true" format="MM/dd/yyyy"/> formatting lightning input is not available. ...
Avijit Chakraborty's user avatar
4 votes

Lightning:input type="date": how to change the date fomat - Summer'18

There's not a way to specify the date format for date or datetime input fields lightning:input / lightning:inputField. This is meant to be controlled by the user's locale per the component library ...
James's user avatar
  • 2,649
4 votes
Accepted

How to add lightning:input to lightning:recordEditForm

The best thing to do for your specific scenario is to 'hide' the lightning:inputField and add a lightning:input, similar to what Uwe Mentioned, however, you dont really need to do anything with the ...
glls's user avatar
  • 20.2k
4 votes
Accepted

Lightning component focus on lightning:inputField

lightning:inputField does not support focus as per their official documentation. src: https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField/specification
Pranay Jaiswal's user avatar
3 votes
Accepted

Dynamic Visualforce Input Field

Any Rerender attribute you use in vf page, should point to an id of an apex component like <apex:outputPanel />,<apex:form />,<apex:pageBlock />,...so on. <apex:actionFunction ......
Praveen's user avatar
  • 10.1k
3 votes

force:inputField does not work in lightning component rendered on VF page

It may wont work properly because of lightning out behavior Excerpt from bookshelf. While the core Lightning Out functionality is stable and complete, there are a few interactions with other ...
RedDevil's user avatar
  • 7,821
3 votes
Accepted

Focus box on lightning:input

The blue border is added by the lightning design system on the slds-input class like this: .slds-input:focus, .slds-input:active { outline: 0; border-color: rgb(21, 137, 238); /* This is the ...
Martin Lezer's user avatar
  • 7,295
3 votes
Accepted

Getting 'multiple items' error despite inputField lookup value being populated with Id in controller

It looks like this is related to the bug posted here: https://success.salesforce.com/issues_view?id=a1p30000000sY09AAE The problem is that lookup fields have issues when the rerender attribute in an ...
Jon Crenshaw's user avatar
3 votes

ReRendered form with wrong data on inputFields dependent picklist

I found a similar problem on the developer forums from 2008 - If immediate="true" rerender does not appear to work. The general problem was that immediate="true" wasn't well suited to scenarios where ...
Daniel Ballinger's user avatar
3 votes
Accepted

ReRendered form with wrong data on inputFields dependent picklist

Dependent picklist works fine with <apex:inputField> when you have static table. It erratically behaves with rerendering by <apex:inputField> (controlling picklist). This strange behavior ...
Santanu Boral's user avatar
3 votes
Accepted

Disabling apex:inputField component with html passthrough attribute

You could change your design to display disabled values. Rather than disabling the apex:inputField better to use apex:outputField using proper rendered condition. Most of the scenarios like ...
Santanu Boral's user avatar
3 votes

Disabling apex:inputField component with html passthrough attribute

Unfortunately, any value for the disabled attribute will disable the field. You can wrap the input field in a conditionally-rendered <apex:outputPanel>. Do something like this so that only one ...
Mike's user avatar
  • 754

Only top scored, non community-wiki answers of a minimum length are eligible