AnsweredAssumed Answered

How to get assigned to user id on record view

Question asked by Muhammad Shaji Uddin on Aug 27, 2015
Latest reply on Aug 27, 2015 by Emil Maran
Hi All,

In record.js I am able to get current user id (var user_id = app.user.id;) but unable to get assigned user id (var assigned_user_id = self.model.get('assigned_user_id');). it showing error in consol

Below is my code (record.js). Any help will be highly appreciable

({   
extendsFrom: 'RecordView',
initialize: function (options){
  this.CheckUserCRMRole();
this._super('initialize', [options]);
  var self = this;
},

CheckUserCRMRole: function()
{
 var a_url = window.location.origin; // http://localhost
  var b_url = window.location.pathname; // /sugar_dir/
  var f_url = a_url.concat(b_url); // http://localhost/sugar_dir/
  var myArray = f_url.split('/');  
  var site_url = a_url+"/"+myArray[3]+"/";

  var user_id = app.user.id;
  var assigned_user_id = self.model.get('assigned_user_id');

  var ResulData = $.ajax({
  url: site_url+'custom/Common.php?method=Check_SalesAdmins&user_id='+user_id,
  data: jQuery(this).serialize(),
  dataType: 'json',
  success: function(data){
  console.log(assigned_user_id);

  }
  });
},

       _render: function(){
        this._super('_render');
        },

})

Outcomes