Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
1 reply
Subscribers
6 subscribers
Views
1709 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Process
I created an external javaScript. We want to allow a person to enter a date in
Keith
over 10 years ago
I created an external javaScript. We want to allow a person to enter a date in one field and then automatically adjust the date 20 days before for another date. It seems window.FormAPI.setValue("datetime2", myDate); will not work for an Appian date field. I can get it to work for a text field. I looked at limited documentation and could not find an answer. I want to know if this is possible or try to get the user to accept chaining two tasks that will subtract the 20 days to it.
...
OriginalPostID-115554
OriginalPostID-115554
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 10 years ago
This can be easily achieved when using SAIL which I recommend as the best practice but based on your post I think you're not using SAIL yet in which case you're right this feature is not available as part of the Forms API itself but you can definitely update the value using JQuery.
This function does that:
function setDateTimeField(dateFieldID, newDate){
$('#date_date_'+dateFieldID+'_valueDateSingle_fd_component_'+window.FormDesigner.runtimeNamespace+dateFieldID+'_').val(newDate);
$('#date_date_'+dateFieldID+'_valueDateSingle_fd_component_'+window.FormDesigner.runtimeNamespace+dateFieldID+'_').trigger('change');
}
You an find an example at
forum.appian.com/.../9614
. The process model is under Process Models – Forum and is called Date with JS which comes with a JS file called dateUtilities located in Default Community > Temporary Documents Knowledge Center > Temporary Documents >JS libraries
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel