Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Prabhu
Creator
Creator

Select the field on open is not working properly

Hi all,

I want last month to be selected on opening the document. i also have other fields to be selected on opening the document.

Other field selections are working properly.But, last month is not selected because there is no data for last month for the selection of other fields.

I want to set last month selection as priority.

Below is the expression i am using. MonthYear =if(DATE(Max(date#(MonthYear,'MMM-YYYY')), 'MMM-YYYY')=month(TODAY()) & '-' &year(today()), DATE(Max(date#(MonthYear,'MMM-YYYY'))-1, 'MMM-YYYY'), DATE(Max(date#(MonthYear,'MMM-YYYY')), 'MMM-YYYY'))

stalwar1

1 Solution

Accepted Solutions
sunny_talwar

What exactly are you testing here? May be this

=If(MonthStart(Max({1} MonthYear)) = MonthStart(Today()),

     Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY'),

     Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY'))

View solution in original post

3 Replies
sunny_talwar

I guess you are using Select in Field trigger on MonthYear field, right... try this as the search string


=Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY')

Prabhu
Creator
Creator
Author

Hi Sunny,

Thanks for quick response. In my case,i am going to use the below expression for field trigger. Please correct me if am wrong.

=if(Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY')=month(TODAY()) & '-' &year(today()), Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY'), Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY'))

@stalwar1

sunny_talwar

What exactly are you testing here? May be this

=If(MonthStart(Max({1} MonthYear)) = MonthStart(Today()),

     Date(MonthStart(Max({1} MonthYear), -1), 'MMM-YYYY'),

     Date(MonthStart(Max({1} MonthYear)), 'MMM-YYYY'))