Sharepoint Make a custom list read only - sharepoint-2007

I have created a custom list. I am using the same list in sharepoint designer through a page.
I a have a datetime field in the form. I want to make a default current date and time and let it make readonly.
How can I do the same.
thanks

As I understood you, you want to set custom permissions on a date field (column) in a custom list. Sharepoint 2007 does not allow column-level security via the UI as far as I know.
If you deployed the list definition via Feature you can set the site columns to be read-only by setting the field to read only via its column definitions like so:
Hidden="FALSE" ReadOnly="TRUE" Required="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Node=""
An easier solution is to use third party tools such as the Sharepoint Tool Basket. It has a feature called "List Manager" which allows you to set columns to read-only if it's not a system column - see the codeplex site for screenshots.
As for your datetime field having the date of Today, you can just create a new Site Column of type Date/Time and set its default value to be "Today".
So the easiest solution would be: Install the List Manager and activate the feature for your site. Create a new site column "Today" of type Date/Time with default value set to Today. Afterwards set the site column to read-only via the List Manager.

Related

TFS 2015: default value for old workitems

TFS 2015.2.1. I have a workitem with custum fields. I have seen that if I set a default value (a new rule for the template) this does not auto-populate pre-existing records.
While new records get the default value, the existing records remain with no value in the new field: if I open the workitem I can see the field
with the default value populated (also with old records) but this value is saved only when you save the workitem.
You can see this with a query: if you search workitems with "the default value" you will find only new workitems or old workitems re-opened and re-saved.
Is it possible to save a default value in old records?
I've tested in TFS 2015.3, when apply a default value with DEFAULT rule to a custom field like the example below, the pre-existing records also has this value:
<FieldDefinition name="version" refname="version.version" type="String">
<DEFAULT from="value" value="1.0" />
</FieldDefinition>
You may upgrade your TFS to TFS 2015.3, and set a similar rule as my example, your pre-existing records should have the default value too.
I've had this "issue" in the past, and your observations are right. Changing rules on a field in the work item template won't affect existing records until you open and save them. Therefore, you'll have to update existing records to populate your new fields with their respective default value.
You may use Excel to mass-edit the existing records and achieve your goal.
TL;DR; I have has this problem before and created a tool to bulk edit work items and fill out the values
1-1000 Work Items
Just use the Web Access bulk edit. Multi select in the web, right click, and select Edit.
1000-10,000 Work Items
Create a Query and then Open Excel and connect to TFS/VSTS and open the query. Bulk edit from here and publish.
10,000+ Work Items
Us the VSTS Sync Migration (https://marketplace.visualstudio.com/items?itemName=nkdagility.vsts-sync-migration) tools to bulk edit one or more fields in any number of work items. Use the "UpdateWorkItem" processor with as many "Field Mapps" to make the changes that you need.
Note: There are some inaccuracies in the documentation but if you install with Chocolatey you can use "vstssyncmigrator init" from anywhere.

"[Me]" variable for custom field alerts in TFS 2013

I added a custom field (Test Prime) in TFS. Since I wanted a drop down of valid TFS users, I copied the setup of the Assigned To control (String, Dimension, ALLOWEXISTINGVALUE, VALIDUSER, and SYNCNAMECHANGES). I want to be able to set up an alert triggered when:
Test Prime Changes to [Me] or Test Prime Changes from [Me]
but "[Me]" or "#Me" does not seem to grab the current user. It's under the drop down menu of Assigned To so I don't see why I can't get access to this variable. Is it because this is for a non-core field and [Me] is only available for core fields? If yes, is there a workaround because I haven't been able to find any.
set the syncnamechanges="true" in the custom field definition. If the workitem template cannot be uploaded, use the witadmin tool to update the syncnamechanges attribute.
in the alert rule, use ##MyDisplayName## placeholder instead of [Me] or #Me.

JIRA gadget: how to disable a configuration field

Is there a way to disable a configuration field for a JIRA gadget based on the value of another field?
Example: when the user chooses 'Now' for field Foo, then the Date field is ignored. I'd like to disable the Date field. Can this be done? If so, how? I already do the ignoring part. But my only clue for the user that I am ignoring the Date field is my description for Date and Foo. It would be nicer to disable the Date field as well.
If you want to do anything other than use the built-in gadget controls with their standard behaviors, you need to implement your own gadget configuration code instead of relying on the UserPrefs directly.
This means that, in practice, that you need to omit the "configuration form" from your gadget descriptor, which is this part:
config: {
descriptor: function(){...},
args: {Function, Array}
},
After having removed that, your gadget will then need to build its own UI and decide itself whether or not it still needs to be configured, as well as call gadget.getPref() and gadget.savePref() to get/set your user's gadget configuration options in the parent container.
I should add that this is a fair amount of work. You might be able to do some hacky jQuery to override the standard controls built without doing the above, but this will not likely be portable to different parent containers (or even different versions of JIRA).

How can I add text to a work item

We have a few bugs and change requests which have a complicated iteration path. This results in people coming over the team to ask 'Where do we raise items' a lot.
As you can't set a default value for the iteration path in TFS 2010 we think the best solution would be to add a string of text under the field which we can manually update every 7 weeks with the correct area to raise items in.
However TFS doesn't seem to allow just a line of text on its work items as a control. Is there a way to add a line of display text i.e. Not a field you edit, but just to inform those writing the items?
Please note that it needs to be visible at all times, using the tooltip 'help text' field on a control is not enough in this case.
You can use the LabelControl for this purpose.
You can not have a default in the work item for the iteration path, but what you can do is making use or the template url in web access or the work item templates in the power tools to create a work item that is prepopulated with values.
What about a custom field with a display control in read-only? You can give a default value to the field and the "read-only" control prevent other to change it.

Rename work item type fails

In TFS2010/TFSPowerTools2010/Process Explorer I am creating a custom process template. I define a new work item type (WIT) called "Enhancement" copied from the CMMI "Change Request" WIT.
Then I want to rename the friendly field name of the work item type "System.Title" (called "Title") to "Summary".
When I upload my custom process template to the TFS server and create a team project, and then create a new Enhancement, the info in the required field text still shows :
"TF20012: Field "Title" cannot be empty.
Why ?
(I want to see "TF20012: Field "Summary" cannot be empty.)
What you can do is create a new field and make it required. Call it Summary, etc. Change the Title label and textbox from the stock values and point it to your new field. Do not remove the System.Title field from the field list.
In the work flow, use the Summary value to populate the System.Title field, which is not on the form. Then if they try to save without a Summary, they will get the correct error and System.Title will have a valid value for reporting.
Be sure you account for the System.Title field everywhere it is referenced in the work flow.
You aren't able to rename a system field like System.Title. It's used by other work item types across the team project collection and the server instance. It also has to be filled in by the default rules. You can rename the "label" that gets shown to the end user by going to the layout tab of the work item type editor (in the TFS Power Tools) and find the control and change it's label attribute but leave the field the same.
In Visual Studio I was looking at a WinForm and saving the form I got this error:
Microsoft Visual Studio Save failed.
TF20012: Field 'Title' cannot be empty.
OK
Since its a TF error I closed all the Work Items (even unsaved ones...) and then saving the Winform worked.
I am not sure how VS thought the Work Item was the active code window I saw looking at.

Resources