AnsweredAssumed Answered

How to access a team's users in record.js for validations in 7.2.2.0?

Question asked by KD KD on Aug 29, 2014
Latest reply on Sep 18, 2014 by paperless
Hi,
 I am  looking for Retrieving data from Team users's supanel a in achieving the same in sugar 7.2.2
Now, I get team and Team users using code below 

var userTeam2 = App.data.createBean('Teams',{id:'e8566565-0d27-2f09-edf5-52c67c376d41'});
userTeam2.fetch();
var myTeamusers = userTeam2.getRelatedCollection('users');
myTeamusers.fetch({relate:true});
var u= myTeamusers.toJSON();
u.each(function(e){
 if(App.user.get('user_name') == e.user_name){ 
  console.log('step7');}})
Now I am getting the value when  run this code on Chrome Browser consloe, but unfortunately when I put same code it in custom/modules/Accounts/clients/base/views/record/record.js for validations, then I get empty value in  'u' variable and it shows the message undefined.
Can you please tell me how to retrieve the value in record.js file from this collection of objects?

Thanks !
DIkshit

Outcomes