How can i bring the company name of the logged in user ?

Shiva prasad t
Tera Guru

I have a requirement to show the company name of the logged in user along with the username herein service portal: pp.png

I worte this lines of script in client controller and in HTML, but it's showing sys_id of the company record.

HTML: 

<span class="visible-lg-inline">{{::user.company}}</span>

Client controller : 

company: $scope.user.company,

 

 

I want show the company name along with the user name 

 

any help would be appreciated

 

Thanks,

shiva

1 ACCEPTED SOLUTION

Weird
Mega Sage

Try adding .getDisplayValue() at he end of $scope.user.company and see if that's enough to show it.
On server side you could also just save it somewhere like

var company = gs.getUser().getCompanyRecord();
data.companyName = company.name;

View solution in original post

2 REPLIES 2

Weird
Mega Sage

Try adding .getDisplayValue() at he end of $scope.user.company and see if that's enough to show it.
On server side you could also just save it somewhere like

var company = gs.getUser().getCompanyRecord();
data.companyName = company.name;

Hello @Weird

 

thanks for your suggestions it's worked almost.

but we added one thing here like this  

var company = gs.getUser().getCompanyRecord();
data.companyName = company.name.toString();