Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Field Security Profiles with Javascript

(0) ShareShare
ReportReport
Posted on by 630

Hello Dears,

I have the following scenario where I hope someone can help me.

I have a secured field which is secured by field security profile for some users to prevent read its value.

The problem is that I need to read this field's value in javascript and do some logic based on it, but it since the logged in user doesn't have privilege to read this field value, the Xrm.Page.getAttribute(<securedfieldname>).getValue(); returns null, which means I can't read it. 

Is there any way to read the field's value in javascript but keeping it secured on form and advanced find?

Thank you for your help in advance.

*This post is locked for comments

  • Verified answer
    Nadeeja Bomiriya Profile Picture
    6,804 on at
    RE: Field Security Profiles with Javascript

    Hi Osama,

    +1 for Guido's answer.  If you can read a secure value in JavaScript then security is breached.

    But you can call a Custom Action from JavaScript which runs on server side and get it to return a response.  You write the trigger in JavaScript (Client-side) and the logic in Custom Action (Server-side) which you can configure to run under a different user's context.

    IMPORTANT: Never return sensitive data back to JavaScript.

    blogs.microsoft.co.il/.../executing-custom-action-via-javascript

    www.magnetismsolutions.com/.../Call-Action-in-CRM-2015-Easily-from-JavaScript-Library

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,910 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,782 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans