Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Mask FullName on Contact Entity

Posted on by Microsoft Employee

Hello all,

Im trying to mask the firstname ,middlename ,lastname fields fro Contact Entity. Normally to mask field you should enable field security at edit field. But for these fields the option is not editable. Because these fields are the part of composition , I've tried to enable at fullname but It doesn't work either. Is there anyway to mask these fields without losing data in fields (If there is any solution, I can mask from db too)

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Mask FullName on Contact Entity

    Hi partner,

    You could try this way.

    1.Create three custom fields named firstname1, middlename1, lastname1 in Contact and put them on the form and hide fullname field on the contact form at the same time.

    2.Enable field security of firstname1, middlename1, lastname1.

    3.Create a workflow when creating a new contact. When we create a new contact, the system will assign the value of firstname1, middlename1, lastname1to fullname.

    4.Update the values of the full name field to firstname1, middlename1, lastname1 fields in bulk.

    This allows us to solve the problem of native fullname field not being able to set field security.

    5.About how to hide the name of the contact in the image on the top left of the form, we could use js to do this.

    First we get the div id of contact name from F12 development tools.

    community428.png

    Then we add the following code to "Onload" event of contact form and publish.

    var hide = true;
    var interval = null;
    function hideName(){
        interval = setInterval(function () {
            var element = parent.document.getElementById("FormTitle");
            if (element != null && hide == true) {
                hide = false;
                element.style.display = "none";
                clearInterval(interval);
            }
        }, 1000);
    
     
    }


    community428.png

    Hope it helps.

    Best Regards,

    Leo

  • ThomasN Profile Picture
    ThomasN 3,190 on at
    RE: Mask FullName on Contact Entity

    You would need to store the data somewhere, either in another hidden field on the form, or in memory (which I don't recommend). Sorry I don't know enough about JS to answer completely. I know I have seen this done using JS before.

    If you are not sure, I would recommend the custom fields replacing the OOTB fields, but make sure to keep those OOTB fields up to date with business rules so other features that may need to reference those fields can be leveraged. Or you decide that those fields should never be used on an email template or contract, etc. then just leave those blank and hide your custom fields. You can recreate new_fullname as a calculated field using the other new_firstname, new_lastname fields.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Mask FullName on Contact Entity

    If I do with JS, Ill lose data in fields ,right?

  • Suggested answer
    ThomasN Profile Picture
    ThomasN 3,190 on at
    RE: Mask FullName on Contact Entity

    Hi Hasret, thanks for reaching out.

    You are correct those system fields cannot be masked. You would need to have JS on the form that did this for you, but if it needed to me more secure then you would want to create custom fields and secure those with Field Level Security. You could keep those fields updated using a business rule set to run for any system changes to the OOTB fields.  

    Sorry I don't have a better option for you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans