DateTime Picker

M

melon

How do I access the Date Time Picker, and then change the value to
today's date?

I tried this:

XDocument.DOM.selectSingleNode("/dfs:myFields/my:SPADate").Value =
today();

but I get an error message: Object expected

What could be the problem?
 
W

WanttoLearn

Click on fx button in the date picker properties
Click insert function
Click Date and Time
Click on Today

Put the value Today()
 
M

melon

Click on fx button in the date picker properties
Click insert function
Click Date and Time
Click on Today

Unfortunately there is a problem with that. For example, when I first
open the form, it will insert the date (say March 10). However if I
save the form and then reopen it and submit it few days later, the
date would not change, still March 10 even though it is already March
17. I need a function that will register the date when the form is
submitted.
 
C

Clay Fox

You either need to check the update check box or use a rule on submit.

Where you enter the default in properties there is a check box below which
governs how the field is updated.

Or on your submit add an additional rule which stes the fields to today.
 
M

melon

Is there a way to set rules on submit then? I can set the button
action to Rules and Custom Code, which let me set the rules and I just
use the code XDocument.Submit(). That works fine, but if there is an
error (validation error for instance), then the form will generate
some technical error message instead of the normal user friendly error
message.
 
C

Clay Fox

Yes under tools and submit options.

You can enable submit with Rules and then also set your custom messages in
the advanced options.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top