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
7 replies
Subscribers
8 subscribers
Views
3467 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I have tried everything i know to get this to work: we have a date field th
marieh
over 9 years ago
I have tried everything i know to get this to work:
we have a date field that is defaulted to today() or user can select what date they want. it displays great, saves to the DB correctly.
But when it is pulled back from the DB it is 2 days off and will display 2 days off is there anything that can get this to display with the original date. Code Example below: And this is a DATE field not a DateTime. Thanks in Advance
Users Input field
a!dateField(
label: "Effective Date",
labelPosition: "ADJACENT",
required: true,
readOnly: false,
value: if(rule!APN_isBlank(ri!LTR_Processing_Cdt.effectiveDate),today(),ri!LTR_Processing_Cdt.effectiveDate),
saveInto: ri!LTR_Processing_Cdt.effectiveDate,
validations: if(
ri!LTR_Processing_Cdt.effectiveDate > today(),
"Date entered must be less than today",
if(
ri!LTR_Processing_Cdt.effectiveDate < today() - 180,
"Date entered must be greater then the past 6 months",
null
)
)
...
OriginalPostID-185910
OriginalPostID-185910
Discussion posts and replies are publicly visible
0
marieh
over 9 years ago
...)
User Display Field
a!textField(
label: "Effective Date",
labelPosition: "ADJACENT",
readOnly: true,
value: todate(LTR_Processing_Cdt.effectiveDate)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shailendras593
over 9 years ago
Is your CDT field "Effective date" a date-time field?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ankitb0003
over 9 years ago
I am assuming that you are saving as Date Time:
todate function convert the input date time to GMT and hence you are able to view the different date then inputted.
Refer:
forum.appian.com/.../Conversion_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marieh
over 9 years ago
the database is a Date
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sonalk
over 9 years ago
Use now() function and then wrap it in text function with the desired date format, that can be sent to the todate function.
Example : todate(text(now(),"mm/dd/yyyy")) will provide an output as 24/12/2015
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jaggu
over 9 years ago
Display the cdt values on screen to cross check the date field is fetching properly from DB. If it retries correctly. Then try null check.
Your code looks good to me. Please display and cross veryfy
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
marieh
over 9 years ago
We have figured out that it is may be upgrade issue to 7.11 it looks good when user selects date it saves to the DB correctly. But when you pull it back from the DB it is 2 days off which is making it display 2 days off.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel