Skip to main content
saidivyam
November 15, 2022
Question

Date field component

  • November 15, 2022
  • 11 replies
  • 0 views

Hi All,

        I have used date field components.In that   I have two buttons with it like submit and cancel. When ever I enter invalid date and cancelled it and I again edit it it showing the invalid date as a default even though it is not storing in any of the localvariables.

Any leads can be really helpful ..

Thanks & Regards

Divya

11 replies

November 15, 2022

Hi, is validate true for your cancel button?

saidivyam
saidivyamAuthor
November 15, 2022

@ujjwal,It is not  a button but a rich text component.

November 15, 2022

Ohh sorry my bad as we can see the date in the input is not in the proper format it is therefore not taking it and saving it.

mikes0011
Brainy
November 15, 2022
When ever I enter invalid date and cancelled it and I again edit it it showing the invalid date

Can you explain in more detail here what you're doing, and what's happening that you believe is incorrect?  Are you just looking in the Interface Editor when you're seeing this behavior?

The Expression Guru
gopalk2865
Participating Frequently
November 16, 2022

Hi Divya, can you share the code for your date field configuration?

saidivyam
saidivyamAuthor
November 16, 2022

a!localVariables(
local!postingDate: todate("10/10/2022"),
local!editPostingDate: false(),
local!oldPostingDate: null,
{
a!richTextDisplayField(
label: "Posting Date",
labelPosition: "COLLAPSED",
value: { "Posting Date" }
),
a!richTextDisplayField(
labelPosition: "COLLAPSED",
value: {
a!richTextItem(
text: local!postingDate,
link: a!dynamicLink(
value: local!editPostingDate,
saveInto: { a!save(local!editPostingDate, true()) },

),
color: "#212121",
size: "MEDIUM_PLUS"
)
},
showWhen: not(local!editPostingDate)
),
a!dateField(
value: local!postingDate,
saveInto: {
a!save(local!oldPostingDate, local!postingDate),
if(
rule!APN_isBlank(local!postingDate),
a!save(local!postingDate, local!oldPostingDate),
a!save(local!postingDate, local!currentDate)
)
},
showWhen: local!editPostingDate
),
a!sideBySideLayout(
items: {
a!sideBySideItem(
item: a!richTextDisplayField(
value: {
a!richTextItem(
text: "SUBMIT",
link: a!dynamicLink(
saveInto: {
if(
rule!APN_isBlank(local!postingDate),
a!save(
local!ULF_cases,
a!update(
local!ULF_cases,
"postingDate",
local!oldPostingDate
)
),
a!save(
local!ULF_cases,
a!update(
local!ULF_cases,
"postingDate",
local!postingDate
)
)
),
a!startProcess(
processModel: cons!ULF_PROCESS_MODELS[2],
processParameters: { ULF_cases: local!ULF_cases }
),
if(
rule!APN_isBlank(local!postingDate),
a!save(local!editPostingDate, true),
a!save(local!editPostingDate, false())
)
}
)
)
}
),
showWhen: local!editPostingDate
),
a!sideBySideItem(
item: a!richTextDisplayField(
value: {
a!richTextItem(
text: "CANCEL",
link: a!dynamicLink(
saveInto: {
a!save(local!postingDate, local!oldPostingDate),
a!save(local!editPostingDate, false),
if(
rule!APN_isBlank(local!postingDate),
a!save(local!editPostingDate, true),
a!save(local!editPostingDate, false())
)
}
)
)
}
),
showWhen: local!editPostingDate
)
}
)
}
)

mikes0011
Brainy
November 16, 2022

The Expression Guru