2

I have a field called target release date. This is how it's presented right now.

enter image description here

I'm trying to find a better way to provide this control. I was thinking maybe a drop down for Q1-Q4 and one for 2013-2020 or something but I don't know if i can have two controls in there.

Thoughts?

2

One approach:

  1. Split to two fields: TargetReleaseQuarter and TargetReleaseYear - both of type Choice
  2. Use SPServices.SPCascadedDropdowns for linking these dropdowns
  3. Use calculated field for Target Release Date, with formula =TargetReleaseQuarter & " " & TargetReleaseYear

Second approach:

  1. Create a custom field type
  2. Create server-side field control that would include two dropdowns and necessary logic

This approach is heavier but if you prefer working with C# code, it is probably the way to go.

In both cases, existing data must be migrated using some console application.

Third approach:

  1. Add a CEWP to your edit form page
  2. Create javascript that would hide current representation of the field
  3. Create your own representation of the field using js
  4. Each time a value is set using your custom dropdowns, you must update underlying select so that the value is saved correctly when form is submited

In this case data migration is not necessary.

  • What would linking the SPService.SPCascadedDropdowns accomplish sorry. – Batman Sep 13 '13 at 19:31
  • You can see how it works on the SPServices project page. The link is provided in the answer. There is both demo and screenshots there. – Andrey Markeev Sep 13 '13 at 19:32
2

I would be tempted to do it the other way around. The less metadata you have to provide the better - so just have a single release date field. You can then have a calculated column which formats it as above - or again, I would be tempted to create several calculated columns for year, month, quarter etc and you could then use them for filtering etc as needed. Calculated columns are free metadata :)

  • I like this answer and it's probably going to be the best one going forward. – iOnline247 Sep 13 '13 at 21:53
1

You could simply have two fields "Release Quarter" with Q1-Q4 and "Release Year" with 2011 - 2015. You could then create a Calculated Field called "Target Release Date" that concatenates the two fields together. Data entry would have two fields but for reporting you could use the calculated field.

1

I think the best UX is a single dropdown with values like you have, sorted by ascending date. I don't think that anyone is going to see two fields as being easier.

You can use my SPServices function SPFilterDropdown to have it only show future quarters going forward (maybe only show quarters in the next two years or something) if you do a little extra work. That would keep the number of values from getting out of hand.

  • I think i'm going to do it like that actually. The other answers would all require additional columns and that might not be the best UX choice. Do you have any example of how I could filter for only future values? Is this something that can be done with Javascript, I don't know any CAML yet. – Batman Sep 13 '13 at 21:56
  • You can generate the filter values in JavaScript, but you'll have to pass in CAML to make it work. If you make the column a lookup column to another list, you can also do things like marking each value as active or not, or filter just on the contents of a specific view. – Marc D Anderson Sep 14 '13 at 1:56
0

I think the best approach is to split Quarter and QuarterYear and store in two different field, and to show the value you should use a third calculated column that joins the value in some format.

This approach will give you flexibility when you will create view later on. For example if you want to calculate for a Q3 only you just need to define the "Q3" for "Quarter" field in the filter option of view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.