Question


ING Nederland N.V.
NL
Last activity: 5 Jul 2017 6:15 EDT
pxDateTime Control - Custom Date format - is it possible pass the values dynamically using parameters or clipboard property to Custom Format?
My requirement is, user will select the date format in first screen and the same date format should be used in all screens which has date control.
I tried to pass custom date format in pxDateTime control. If I hard code the value, it works fine.
But I need to pass dynamically. I tried javascript but no luck.
Please let me know how to pass the clipboard or parameter value dynamically to Custom date format parameter value in pxDateTime control.
Regards,
Prakash
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!


Cognizant Technology Solution
US
Hi Prakash,
What I understood from your question is, in UI where you are selecting control as pxDataTime you want to send the Data Format dynamically from the section where you are using it. So, why that is required? While selecting the control, in the properties of the control you have many different format you may specify there. Are not they satisfying your requirement? If you want to have some other format, pxDateTime control will not work. You have to write your own control.


ING Nederland N.V.
NL
Hi Arnab,
Our customer has business in multiple countries. As per requirement, in the first screen user will select the country, sub contractor company, date format, currency, etc., and submit the quote. Once the quote is approved, we need to display the date and currency values in the selected format throughout the case life cycle.
So,checking is there any way to pass the custom format value dynamically to pxDateTime control itself?


Pegasystems
US
Note that even if there's no way to dynamically control the format parameter, you could achieve same result by designing your flow to take two different branches according to the desired format, with each branch calling the date-control with the appropriate format parameter, or even using two different date-controls entirely.


ING Nederland N.V.
NL
Hi Ericosman,
Thanks for your response. We have date fields in multiple screens. We need to create many flows and UI as per this approach. Also, it will be huge work in case of any future enhancements.


Cognizant Technology Solution
US
Ok here would be my approach. Have one property which will hold the format and that will be calculated based on your logic. Now in your section do not use just the property to populate the date field. Rather use a section only for the Date field and embed that section in your actual section. Now, circumstance the section containing the date field based on the dateFormat property value.


ING Nederland N.V.
NL
Arnab, Thanks for your response. Yes, it will work. But we have almost 20-30 date fields in 6-8 different screens. We have around 6 date formats. We will have to create 8 * 6 screens. It is tough to maintain all sections if we get any future enhancements.


Cognizant Technology Solution
US
I think you have to just create 6 different sections if you have 6 different date formats. One circumstanced instance for each Date Format and that will be reused in different sections.


ING Nederland N.V.
NL
Hi Arnab,
Thanks for the response. But we have around 8-12 different date properties[Example - Contract creation date, Installation date, Verification date].
Are you suggesting to create 6 sets of sections with different formats for each property?
or is it possible to pass the property as a parameter to the section containing the date controls? Please clarify


EPAM Systems
HK
Hi Prakash,
I think as per your scenario you can write a custom control which is getting the datetime format as a parameter.
Once user select the datetime format,store value to the clipboard and pass that value to the control as a param then within the custom control return the particular format by checking that parameter .
Thanks,
Chathurika


ING Nederland N.V.
NL
Hi Chaturika,
I guess that's the only option left. I tried to avoid creating custom control.Thanks for the response.


EvonSys LLC
GB
Hi Prakash,
Maybe a bit late to suggest an approach now. But I think you can do this without custom control.
As of now we have around 13 different date formats configurable within an auto-generated control. (1/1/01, 1/1/2001, 01,01,2001 etc...)
Assuming client also requires all or lesser number of those formats, you can try doing below.
- Offer the formats in property [drop down mode] for the user to select.
- Lets say the selectable property is DateFormat
- Now create a base/default control with the first format [say 1/1/01 configured within the control]
- Lets say the new control is Date_custom
- Now circumstance this control based on DateFormat property values
- For the second format, you create Date_custom [DateFormat:1/1/2001] circumstanced control
- Configure that format within the control
- This way you'll end up creating 1 base control and around 5-6 circumstanced controls
- In the UI, for all date properties you refer Date_custom control
- Once the DateFormat is selected by the user, UIs will render based on circumstance property
Hope this helps.
Regards, SK
-
Zach Taylor