True/False value appear on User Portal Widget

Donald Small1
Tera Expert

I have created some True/False fields for the sys_user record that I want to be available on the User Self Service portal, so that they can select them.  I have set them as available when you navigate to the sys_user table, select a user and go to the Self Service View, but how do I get them to show when a user goes to his profile from the portal?

1 ACCEPTED SOLUTION

Good call out. I looked in to this. You'd need to clone the User Profile widget, then make a few tweaks, one of which is to comment out or remove this line, 158, in the client script section:

if (models[tableName][field] && models[tableName][field].type === "boolean") return false;

Which is basically telling it to not even display if there are true or false fields. So I commented this out, then in the HTML, I added a line like this for example, on line 34:

<p ng-if="::displayField('sys_user', 'u_name_of_field', true)"><strong class="pad-right">${What I Want to Show Here}</strong><sp-editable-field editable-by-user="data.isLoggedInUsersProfile" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.u_name_of_field"></sp-editable-field></p>

Basically replace u_name_of_field with the column name of the field you want to add and don't forget to edit inside the ${ } what you want it to display, then finally in the client script section, for example, line 7/8, I did:

sys_user: ['name', 'introduction', 'title', 'department', 'location', 'photo',
							 'manager', 'company', 'u_name_of_field'],

 

Please mark reply as Helpful/Correct. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

10 REPLIES 10

I did create the True/False fields in the Service Portal View, but can't get them in the widget.  I am on Kingston Patch 9

Good call out. I looked in to this. You'd need to clone the User Profile widget, then make a few tweaks, one of which is to comment out or remove this line, 158, in the client script section:

if (models[tableName][field] && models[tableName][field].type === "boolean") return false;

Which is basically telling it to not even display if there are true or false fields. So I commented this out, then in the HTML, I added a line like this for example, on line 34:

<p ng-if="::displayField('sys_user', 'u_name_of_field', true)"><strong class="pad-right">${What I Want to Show Here}</strong><sp-editable-field editable-by-user="data.isLoggedInUsersProfile" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.u_name_of_field"></sp-editable-field></p>

Basically replace u_name_of_field with the column name of the field you want to add and don't forget to edit inside the ${ } what you want it to display, then finally in the client script section, for example, line 7/8, I did:

sys_user: ['name', 'introduction', 'title', 'department', 'location', 'photo',
							 'manager', 'company', 'u_name_of_field'],

 

Please mark reply as Helpful/Correct. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

This worked perfectly.  But what does the last step do?  I didn't do that yet, but it is still working as I'd expect it to.

 

sys_user: ['name', 'introduction', 'title', 'department', 'location', 'photo',
							 'manager', 'company', 'u_name_of_field'],

yea, I wasn't sure about that step, but it looked to me like it was grabbing it from the sys_user table or something, may not need to do that step then if it's working.

Please mark my reply with instructions as Helpful/Correct.

Thanks and I'm glad it's working for you!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank you Alan.  You saved me and allowed my to meet a year end deadline.  I appreciate your help!

 

Donald