cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Date Simple Type - Setting Maximum Inclusive to todayDate()

Former Member
0 Kudos

Hi

I have a created a simple type of type date. The user is only allowed to select dates <= today's date.

Is there a way I can set the Maximum Inclusive Date to always be something like sy-datum (current Date)?

thanks in advance

Anton Kruse

Accepted Solutions (1)

Accepted Solutions (1)

former_member185029
Active Contributor
0 Kudos

Hi,

I dont think it takes parameter dynamically.

You will have to validate it through code itself.

Ashu

Former Member
0 Kudos

Is there no way u could programatically change the Max Inclusive Parameter of the custom simple type in the init() method?

thanks

Anton

Former Member
0 Kudos

Hi Anton,

I don't know is this your exact requirement or not:

You can put this code in wdDoInit()

IWDAttributeInfo attr = wdContext.getNodeInfo().getAttribute(<name of your context>);

ISimpleTypeModifiable sim = attr.getModifiableSimpleType();

Date dt = new Date();// will return today's date

sim.setMaxInclusive(dt);

Regards,

Murtuza

Former Member
0 Kudos

that looks perfect. I'll try it and see.

thanks

Anton

former_member185029
Active Contributor
0 Kudos

Yes Murtuza,

That is perfect code..with small change

Use java.sql.Date as below.

Date dt = new Date(System.currentTimeMillis());// will return today's date

Ashu

Answers (0)