javascript - How to make a page in read only for a current User -


my question how make page in read current user using javascript. this:

function function() {     var userid = xrm.page.context.getuserid();     var owner= xrm.page.getattribute("ownerid").getvalue();     var ownerid = owner[0].id;      // if user#owner     if (userid != ownerid) {         //make current user in readonly     } } 

do have idea?

thank in advance

you this:

function onload() {     var userid = xrm.page.context.getuserid();     var owner= xrm.page.getattribute("ownerid").getvalue();     var ownerid = owner[0].id;      if (userid != ownerid) {         xrm.page.ui.controls.foreach(function (control) {             control.setdisabled(true);         });     } } 

but, if requirement prevent users updating records not own, better set write-privilege entity user level.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -