Salesforce Developers (2024)

Gets a field’s value from a record. Spanning fields are supported.

The field’s value is returned in its raw data form. In some cases, the raw data form differs from the display value that’s returned by getFieldDisplayValue(record, field).

  • record—(Required) A Record object from which to retrieve the field value.
  • field—(Required) The API name of the field. The value can be either a string or reference to a field imported from @salesforce/schema. You can specify up to 5 levels of spanning fields. For example, Opportunity.Account.CreatedBy.LastModifiedById returns 4 levels of spanning fields.

The field’s value. A record may be returned if a spanning field is used. If the field you are requesting for doesn’t exist, this function returns undefined.

To get the value of a record’s field, you can use the getRecord wire adapter, which returns the property record.data.fields.fieldName.value. However, you can also call getFieldValue(record, field) to get the value directly.

The field value is returned in its raw data form, which is useful for calculations and comparisons. Here are a few examples of values in raw data form:

  • Currency values are displayed like 350000000.
  • Date values are displayed like 2019-07-13
  • Date/time values are displayed like 2015-06-17T22:17:58.000Z.

Import the field references that you pass to getFieldValue(record, field) from the @salesforce/schema scoped package using the @salesforce/schema/ObjectName.FieldName syntax. For a custom object, use the @salesforce/schema/CustomObjectName__c.CustomFieldName__c syntax. If you use a string to identify a field name like fields: ["Account.Name"], you don't get the benefits that you get from importing a reference to the field. See Import References to Salesforce Objects and Fields.

To display formatted values, use base components such as lightning-formatted-number or lightning-formatted-date-time. The locale set in the Salesforce user preferences determines the formatting.

The base components display the values:

  • $350,000,000.00
  • Wednesday, Jun 17, 2015, 03:17 PM
  • Jul 13, 2014

Alternatively, use the getFieldDisplayValue(record, field) wire adapter to display the formatted and localized value for a field.

See Also

Salesforce Developers (2024)
Top Articles
Sheet Pan Suppers - MyRecipes
Refreshing Paloma co*cktail Recipe!
Spasa Parish
The Machine 2023 Showtimes Near Habersham Hills Cinemas
Gilbert Public Schools Infinite Campus
Brown's Funeral Home Obituaries Lawrenceville Va
Craigslist Apartments For Rent Cheap
Understanding British Money: What's a Quid? A Shilling?
Officially Announcing: Skyward
Momokun Leaked Controversy - Champion Magazine - Online Magazine
Maine Coon Craigslist
How Nora Fatehi Became A Dancing Sensation In Bollywood 
‘An affront to the memories of British sailors’: the lies that sank Hollywood’s sub thriller U-571
Haverhill, MA Obituaries | Driscoll Funeral Home and Cremation Service
Rogers Breece Obituaries
Ella And David Steve Strange
Ems Isd Skyward Family Access
Elektrische Arbeit W (Kilowattstunden kWh Strompreis Berechnen Berechnung)
Omni Id Portal Waconia
Banned in NYC: Airbnb One Year Later
Four-Legged Friday: Meet Tuscaloosa's Adoptable All-Stars Cub & Pickle
Patriot Ledger Obits Today
Harvestella Sprinkler Lvl 2
Storm Prediction Center Convective Outlook
Experience the Convenience of Po Box 790010 St Louis Mo
modelo julia - PLAYBOARD
Poker News Views Gossip
Abby's Caribbean Cafe
Joanna Gaines Reveals Who Bought the 'Fixer Upper' Lake House and Her Favorite Features of the Milestone Project
Pull And Pay Middletown Ohio
Navy Qrs Supervisor Answers
Trade Chart Dave Richard
Sweeterthanolives
How to get tink dissipator coil? - Dish De
Lincoln Financial Field Section 110
1084 Sadie Ridge Road, Clermont, FL 34715 - MLS# O6240905 - Coldwell Banker
Kino am Raschplatz - Vorschau
Classic Buttermilk Pancakes
Pick N Pull Near Me [Locator Map + Guide + FAQ]
'I want to be the oldest Miss Universe winner - at 31'
Gun Mayhem Watchdocumentaries
Ice Hockey Dboard
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Dermpathdiagnostics Com Pay Invoice
A look back at the history of the Capital One Tower
Alvin Isd Ixl
Maria Butina Bikini
Busted Newspaper Zapata Tx
Rubrankings Austin
2045 Union Ave SE, Grand Rapids, MI 49507 | Estately 🧡 | MLS# 24048395
Upgrading Fedora Linux to a New Release
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 6147

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.