Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Make Service portal User Profile Fields Readonly

Sabnam Memon
Tera Contributor

Hello,

I want to make Service portal User Profile Fields Readonly. I followed the below steps.

1.cloned widget name :user profile

2.added code next to the fields I wanted to make as readonly

for ex department


OOB: <p ng-if="::displayField('sys_user', 'department', true)"><strong class="pad-right">${Department}</strong><sp-editable-field editable-by-user="data.isLoggedInUsersProfile" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.department"></sp-editable-field></p>

 change :

<p ng-if="::displayField('sys_user', 'department', true)"><strong class="pad-right">${Department}</strong><sp-editable-field editable-by-user="false" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.department"></sp-editable-field></p>

 3.added this cloned widget to page name : user profile through designer

4.tested it

I followed the same steps. I am able to make the fields readonly. However, it gives me some error on the portal. Please see the attached screenshot. Do you know how I can resolve this error on the portal?

find_real_file.png

 

Thank you!

9 REPLIES 9

Hi Mike,

I checked there is no RCA for the widget I created. 

it may be coming from a script include that uses that function. Do you have any RCA records that are "Requested" or "Invalidated"

No script include that are invalidated or requested. I don't know why its giving that error.

Hi Sabnam,

You may want to reach out to Hi support. I do not recommend commenting out that line, it possibly could be masking a larger issue. The best option is to submit a case to Hi support to assist.

Regards,

Mike

Hi,

Were you able to make all the fields read only on User profile ?

Thanks