When you're in charge of a large Project Server deployment, you might face concerns and issues that are due to the project scaling. When I say "large", I mean thousands of users, hundreds of custom fields, tens of project types, PDPs...
In this context, in order to keep a consistency between lookup tables, custom fields or any other objects, I usually use a naming convention such as "lkp_table name", or "organization_customfieldname" for multi-organization deployment. Thus it means that you do need to find a way to display a custom label for those custom fields, different from the name in the system.
Figure 1: naming convention for lookup tables or custom fields |
It also make sense for out-of-the-box fields such as "project Owner". In many case, the project owner will be a project manager, but it could be a PCO. Thus organizations might want to give a custom label to this native field.
Facing this concern, evenif I'm not a developer, there is an easy way to give custom label. So enjoy it because that will probably be the one and only post I'll ever write about coding. But as you'll see, it is not much difficulty.
We'll make a simple example with the "owner" out-of-the-box field.
Figure 2: default owner field |
First you need to download the following jquery librairy. You can upload the js file to the style librairy of your PWA site collection, accessible from the "site contents" link. Once uploaded, you can download from the TechNet gallery a script provided by a fellow MVP Paul Mather. Download the script for example in your site collection document librairy (sites/pwa/SiteCollectionDocuments).
You can edit the js file and replace the custom label.
Figure 3: update the js file with your custrom label |
Figure 4: add a content editor webpart to the PDP |
Edit the webpart then enter the path of your javascript file (/sites/pwa/SiteCollectionDocuments/ChangeCustomFieldDisplayLabelonPDP.js in my case) and set the webpart as "hidden":
|
Figure 5: enter the javascript file's path in the webpart configuration and hide it |
Et voilà!! The native field is "renamed" as you needed to.
Figure 6: PDP with the new label |
Note that if you have installed language packages, since the code contains the name of the field and not the GUID, you'll need to consider writing in the javascript file the label for custom field in all languages supported on your PWA instance.
**2014-08-01 : need to add a function or it will not work. I'll update the post asap.
**2015-06-22: post (lately) updated with a new code example, based on Paul Mather's excellent post.
**2014-08-01 : need to add a function or it will not work. I'll update the post asap.
**2015-06-22: post (lately) updated with a new code example, based on Paul Mather's excellent post.