You need to sign in to do that
Don't have an account?
rtrigg
lightning:recordViewForm doesn't like 18-char record ids in Spring '18
Hi,
My lightning component started throwing an "invalid record id" error after the Spring '18 upgrade. It turns out that I was passing an 18-char id in the recordId attribute of lightning:recordViewForm. When I made that a 15-char id, the error went away.
Isn't Salesforce supposed to accept both 18-char ids and 15-char ids?
Thanks,
- Randy
My lightning component started throwing an "invalid record id" error after the Spring '18 upgrade. It turns out that I was passing an 18-char id in the recordId attribute of lightning:recordViewForm. When I made that a 15-char id, the error went away.
Isn't Salesforce supposed to accept both 18-char ids and 15-char ids?
Thanks,
- Randy
<lightning:recordViewForm recordId="{!v.simpleRecord.Id}" objectApiName="Opportunity">
<lightning:outputField fieldName="Chart_of_Accounts__c" variant="label-hidden"/>
</lightning:recordViewForm>
where the v.simpleRecord attribute is populated by force:recordData. Now that you've convinced me that it's not to do with 15-char versus 18-char, I'm wondering if it's because the recordId attribute wants a string rather than an Id. Because I'm in Classic, force:hasRecordId doesn't work so I can't get the freebie v.recordId. If you agree about the Id versus String thing, do you know any way to convert inside the attribute assignment? None of these attempts work:
recordId="{!String(v.simpleRecord.Id)}"
recordId="{!v.simpleRecord.Id.toString()}"
recordId="{!'' + v.simpleRecord.Id}"
Thanks!
- Randy