• #26673
     j brahma #598
    Forcetalks

    How to create a Salesforce custom field to display data in a format, in a HTML Template?

    I have a custom text field so I want to display data format like this “XXXXXXXXXX4567” in HTML Template how can we achieve this Please suggest

     

    #26680
    Salesforce | Adarsh Adarsh #958
    Forcetalks

    Hi J,

    HTML templates can only display basic fields. So, you would need a formula field:

    MaskedCustomTextField__c (Text) =
    LPAD(CustomTextField__c,LEN(CustomTextField__c)-4,”X”) &
    RIGHT(CustomTextField__c,4)
    Put the formula field into the HTML template, and you’re good to go:

    {!Account.MaskedCustomTextField__c}
    If you use a Visualforce template, you can put it directly in to your text:

    {!LPAD(CustomTextField__c,LEN(CustomTextField__c)-4,”X”) &
    RIGHT(CustomTextField__c,4)}

     

    Hope it helps 🙂

    #26682
    Salesforce | Neha Neha #956
    Forcetalks

    HTML templates can only display basic fields. So, you need to create a formula field:

    EncryptedField__c Formula’s:

    LPAD((RIGHT(CustomTextField__c,4)),LEN(CustomTextField__c),”X”)

    Put the formula field into the HTML template, and you’re good to go:

    {!Account.EncryptedField__c }

    I have validated with Phone field on Account and it works for me. Hope this helps you too.

    • This reply was modified 1 year, 11 months ago by Salesforce | Neha Neha.
Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.

Popular Salesforce Blogs

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?