Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Default View based on Most Recent Year

Hello,

In my example qvw file, it shows the Year from 2007 to 2015. When I open up the qvw, the current default view is match the current Year range.

How if I only want to show the most recent 3 years in the default view without manually set up condition for year = 2013, 2014 and 2015?  Becuse I could have year, 2016, 2017, 2018 ... ... in the future. Is there a way to set up the defalt view with only the most recent year in listbox. By the same time, I would like to show previous years as options/selection for users.

Thanks in advance,

Becky

1 Solution

Accepted Solutions
sudeepkm
Specialist III
Specialist III

you can use "On Open" trigger as below.

On Open Trigger > Select in Field >

Field Name: Submit_Year

Search String:  ='>=$(=max(Submit_Year)-3)'

Select your alternate state accordingly in the on open trigger menu.

View solution in original post

17 Replies
sudeepkm
Specialist III
Specialist III

you can use "On Open" trigger as below.

On Open Trigger > Select in Field >

Field Name: Submit_Year

Search String:  ='>=$(=max(Submit_Year)-3)'

Select your alternate state accordingly in the on open trigger menu.

Not applicable
Author

Thanks so much! This solved my problem.

A futhur question in my mind is can I only create on "On Open" trigger but apply for two of the tabs?

For example, I can create the 'On Open" Trigger and selet "Submit_Year. Then I will probably need to create the second "On Open" trigger and "Receive_Year". Is there a way only create one trigger with one general date field that will apply on all the tabs?

sudeepkm
Specialist III
Specialist III

That is basically the reason for creating a Master Calendar. In your case it seems if you create a master calendar that would combine all the years in range from two year fields then you can use that field in trigger.

You have alternate states too in your app so I would suggest to be careful implementing a solution so that it won't impact any use cases/ business scenarios.

If those two Year field are required to be used independently then I would think of creating two triggers.

Not applicable
Author

Thanks for giving more details.

I am having trouble for my Master Calendar now. It only applies on Case_Receive tab but doesn't work on Case_Submission tab. I posted another one for this issue Master Calendar/Canonical Calendar

For your second suggestion, I know it make sense. But I am not sure how a solution could impact user cases/business scenarios. Do you mean that maybe a user want to see the updated result based on their date selection on both tabs?

Thank you!

Becky

sudeepkm
Specialist III
Specialist III

I'll go through the other post.

So if your requirement is that end users want to select a single date field and that would be applied to all the date fields in the application then you would need to try some field event triggers that would be applied to both the date fields. I think you are currently using Variable event trigger but that is only applied to Receive date.

In case users want the two dates to be driven independently then you can use it as you have now. One tab for receive and other for submit.

Not applicable
Author

Thank you! I will discuss with users then to see if I need to change my approach.

Best,

Becky

Not applicable
Author

Hello,

Can you please let me know how to do, if I need to set the most recent 3 year in dimension or expression in a chart?

This solution doesn't work...='>=$(=max(Submit_Year)-3)'

Thanks,

Becky

sunny_talwar

How about this?

.='>=' & Max(Submit_Year)-3

Not applicable
Author

Thanks Sunny...Still doesn't work...