Repository navigation
Add DISPLAY function: format a field's value by its field type and the running user's locale - #251
Merged
Merged
Conversation
…e running user's locale DISPLAY(field) returns currency with its symbol and scale, numbers and percents at their field scale, and dates and datetimes in the user's locale and time zone. Values that do not come straight from a field are returned unchanged. Works on merge fields, relationship gets, and inside MAP over child records.
…he Build workflow can release again The 2026-09-04 Build created and promoted 1.55.0-1 (04tRb000005c7FJIAY), then failed on the docs step because apexdocs was not on PATH, so the version bump, alias and docs/public/packages.json were never committed. Records them, so the next release is 1.56.0. Adds DISPLAY to the function reference and the editor's autocomplete list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DISPLAY(field)formats a field's value the way Salesforce shows it to the running user:DISPLAYreturns$1,234.50,$0.30%:30%Date.format(), in the user's localeDatetime.format(), in the user's locale and time zoneIt works on a merge field (
Amount), a relationship get (Account.AnnualRevenue), and insideMAPover child records (Opportunities -> MAP(DISPLAY(Amount))).Why
Prose shows merge fields in notes. A raw
Evaluator.runresult loses the field's type, so Prose rendered141.40without a currency symbol,0.3for a$0.30price, and2027-03-17 00:00:00(GMT) for a datetime. Prose will wrap the field references it evaluates inDISPLAY.Changes
DataFunctions.DisplayFn: new standard function.Environment.getContext(): now public, so the function can find the record behind a merge field.CurrencyIsoCodeis used when it was queried; otherwise the user's default currency is used.Tests
DataFunctionsTest.Release
Merging releases 1.56.0 automatically: the
Buildworkflow runs on every push tomainthat touchesexpression-src, creates and promotes the version (cirrus flow package), regenerates the docs, and commitsdocs/public/packages.jsonwith the new id.That workflow has failed since 2026-09-04. The run for 64a74ed created and promoted 1.55.0-1 (
04tRb000005c7FJIAY), then stopped atcirrus run docsbecauseapexdocswas not on PATH. Its version bump, alias andpackages.jsonupdate were never committed, and the next run would have tried to create 1.55.0 again. This PR:Expression@1.55.0-1and1.55.0.NEXTinsfdx-project_packaging.json;docs/public/packages.jsonat 1.55.0-1;npx apexdocs markdown, so the docs step finds the binary.Other changes
PR Buildnow runs on the latest Node 22. Salesforce CLI 2.158 crashes on the pinned 22.14.0.DISPLAYis added to the function reference and the editor's autocomplete list.