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

Disable inputfield in a table for past months

Hi all,

I have a table of sales with customer, item, month and quantity.

I setted the quantity to be an input field in order to let the user to input some values, and this works.

Then I would like to let the user to modify the quantity only for the future months, and the past months should be a readonly field.

I tried to do something like this:

if (

  month_id >= Year(Today())*100+Month(Today())

  , InputSum ( forecast_qty_SIM )

)

but the field is always in read only.

(I have already checked the condition and it is correct)

Do you have any idea?

Thanks

stefano

7 Replies
Not applicable
Author

what is the value of month id - in the coce you provided above, the expression Year(Today())*100+Month(Today()) will result in the value of 201512?

you may need to put parenthesis around either side of the '*' but the number comes out very high

=(Year(Today()))*(100+Month(Today()))

what date or value are you expecting???

Not applicable
Author

year(today()) * 100 = 210500?

Anonymous
Not applicable
Author

Hi Adam,

month_id field is in the format YYYYMM and the condition "Year(Today())*100+Month(Today())" returns the data in the same format (es. 201512).

My question is: how can I set the future month with the inputfield, and past months without it?

Thanks

stefano

Not applicable
Author

can you supply a,list of month_id values that are in your applciaiton.  It looks like you are comparing 2 YYYYMM fields to each other.

have you tried having both fields in the num format?

can you post a sample qvw?

Anonymous
Not applicable
Author

Adam, the issue is not on the date condition (it works, I am sure about this).

My problem is how to set a field to be input field in some conditions, and to be a read only field in other condition.

In my example the condition was based on the month, but it could be based also on the customer, or on the item.

Thanks

stefano

swuehl
MVP
MVP

I don't think you can enable / disable the input field per dimension value at all using a conditional

Have you seen a demo showing this somewhere?

Not applicable
Author

I understand what you are trying to do much better but as swuehl said, I do not believe you can change a dimesnion in that manner

some other options might be is to when you write out your data, you can do the check at tht point or there are more advanced extension objects that handle updating of fields, but that is updating the source of the data (the extensions are from KT Labs - )