Based on two fileds i need to calculate the days.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 05:59 AM
Hi there,
i have two fields start date time and end date time, the users will fill the form in portal they will select start date and end date then it will calulate difference between days.
i done my code it's shoiwing days with decimal number, i don't need decimal number , how can i restrict
in syslog i am getting correct only but when i am setting the value it will taking decimal number
Please find the source code for reference let me know i need to change anything in the script.
script include:
---------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 06:10 AM
Hi @Gillerla Rajesh,
Out of interest, what 'type' field is your 'u_days' field? Can you confirm by the dictionary please?
Also, can you confirm if this is a calalog/record producer variable or a standard table form that's rendered on the Portal. (It will help with setting the value as they slightly differ)
Your script when tested works fine for me and returns the value correctly as a String.
If this is not catalog/record producer variable, I suspect your 'u_days' field is of type 'decimal' - Please confirm.
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 06:22 AM
Hi @Robbie
it's single line text field only, yes code is correct in backgroudn scipt it will returning the integer number, but when i am setting to the days field it will returning decimal number.
can u tell me how can i remove decimal number ?
is there havig any remove() is there ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 06:26 AM
Hi @Gillerla Rajesh,
In your variable, go to the Type Specifications, and change the Validation Regex to Number.
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2024 06:39 AM
Hi @Saloni Suthar ,
i already tried that one also , after setting the value it will showing error messge like it's not number like that.