How to create a new field using IterationPath as data source - tfs

We want to extend the bug work item template with a new field called Found In Iteration. This field, what a surprise, should contains the iteration the bug was found in. But when I created the new field of type TreePath, I got an error when importing the process template into the Team Project Collection (TPC) stating that TreePath is only a valid field type for IterationPath and AreaPath fields.
Looking at that I'm wondering if there is at least any way to add a field to a work item template that uses the iteration path as data source and stores the selected value in another field (e.g. FoundInIteration).

This is not possible. There can neither be custom fields of type TreePath nor fields refering to System.IterationPath.

Related

ComboBox with hidden keys

Is it possible in vaadin 12 to have comboboxes such that it displays a user-friendly value but behind the scenes it stores a hidden code? I found this example from 5 years ago but it doesn't apply to Vaadin 12 comboboxes: https://vaadin.com/forum/thread/7821327/combo-box-hidden-values
(If there's a good, reasonably clean way to do it, please point me in the right direction! I would think this is a common sought-after feature)
Items are assigned to ComboBox either directly using setItems or indirectly through setDataProvider.
The item itself is not sent to the browser and shown in the dropdown. Instead, for each item ComboBox generates a string label that is shown in the UI and an internal id that is used on the server for mapping back to the original item instance when the user makes a selection.
The generated id is internal to ComboBox and has no external meaning. In particular, it's not based on any value in the item itself such as the item's primary key in the application's database.
The label is by default based on doing toString() for each item. You can customize how the label is created by assigning an item label generator callback that receives an item instance and returns the label string to use for that item.
If you for example have a combo box for selecting persons, then you could configure it in e.g. this way:
ComboBox<Person> personSelector = new ComboBox<>();
personSelector.setItems(allPersons);
personSelector.setItemLabelGenerator(person ->
person.getFirstName() + " " + person.getLastName());
If I understand you correctly, there is built-in feature in ComboBox for this, the method is called setItemLabelGenerator(..), which allows to define e.g. lambda expression that returns String which is used for ComboBox items instead of the property from underlying data object.
The linked Forum discussion you found is about similar thing in our previous generation of the framework, there has been some renaming of the API here.

TFS 2013: work item customization: need TreePath functionality for custom field

I am trying to customize a work item template and need to add a field which can capture hierarchical data.I am using TFS power tools to edit work items. I tried to create a new field with datatype as TreePath but when I save it, it throws an error:
TF26179 – Field Type 'TreePath' can be used only with System.AreaPath & System.IterationPath
Is there any workaround to use the TreePath control for custom fields?
This should be duplicated with this thread : TFS 2013: Custom TreePath Fields.
Just as the error message mentioned the Field Type 'TreePath' can be used only with System.AreaPath & System.IterationPath.
So, Tree Path is not supported for other fields for now, and there is a user voice submitted to request the feature, you can vote it or submit a new user voice to suggest the feature.
For custom control, you can reference the source code of the vsts-extension-color-control
You can't create a new field with TreePath data type, but you can create custom controls for other data types, so you can create custom controls that display hierarchical information as long as you are able to represent this in an existing data type, in practice the String type.
Examples of custom controls at https://witcustomcontrols.codeplex.com/.

Retrieve culture specific value of definition field in uCommerce

We're creating some custom fields by adding new definition fields to category and product definition items in uCommerce.
When we retrieve an instance of the ctegory or prouduct from the uCommerce.Entitiesv2 we're having trouble getting the culture specific value for these fields when multilingual is selected?
There is a collection on the Product object called ProductDefinitionField but not sure whether .Value returns the culture specific version of whether we need to call another method (extention method maybe)
Has anyone got a code snipper for this?
When accessing or retrieving Multilingual properties on a uCommerce you can use the GetProperty method on a product.
It has two overloads, one taking name (string) and another one taking name (string) and culturecode (string).
If you want to retrieve the full collection of multilinqual properties you can use GetProperties which also have two overloads. One without parameters and the other with a string culturecode.
Depending on the version of uCommerce you're using some of them might be missing/not a part of the API.
Best regards Martin

How to create new fields in cloud kit?

I'm having an issue with the fields (or attributes, they used to be called) in my cloud kit database. Whenever I create a new field, the records that are stored in that field are always titled "No Name" according to the record type ("State") despite what the actual record title which is "happy" as shown here:
I already tried editing and saving the record it again but that did not work. Can anybody help clarify this issue?
When looking at actual records in the public database in the CloudKit Dashboard, it looks at the field names for that that record type (the "State" record type in your case) and tries to pick the one most likely acting as a title. If the field it chooses has an empty value, it shows "No Name" for the title.
Looking at your screenshot, it seems to be picking the first field ("WI") and showing it's value, which is not set for the selected record.
On a separate note, it seems odd that you have what look like state abbreviations as field names for your State record type. It's possible that you want an "abbreviation" field on your State record type, where the value might be "WI" or "CA".

How to create a dictionary list type property for document type in Umbraco?

I am quite new to Umbraco. I want to create a new property in my document type. This property is a list which contains items like dictionary type which has a key and a value. User can select multiple of these. For example
My document type is "Product", The property I want to create is "Related Items". Each related item will have an name & a url.
Can someone please give me an idea how to do this?
Cheers
You can use the default data types of Umbraco for it: http://our.umbraco.org/wiki/reference/default-datatypes (The wiki doesn't seem updated, but an the ultimate picker will get you the result you need, for example) You can do this in the developer section, create a new one from the defaults and add it to your document type afterwards.
You can also build a custom one, wich is becoming more and more easy, but the approach of doing it is now different in the new umbraco 7 version. Which version are you using?

Resources