phenom94 Posted September 20, 2017 Report Share Posted September 20, 2017 I'd like for some elements to be visible based on date. So, for instance, I'd like the calendar item to show a reschedule link if the date is not within 5 days of the appointment time. I'm not sure how to do this on the calendar view because there seems to be no way to use rules. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 20, 2017 Report Share Posted September 20, 2017 You need to add a FORMULA field to your table to calculate 5 days before appointment : Dateadd(day, -5, [@field:AppointmentDate]) Select [@field:AppointmentDate] from picker. Then in your report you need to have the following code in HTML Block <div id="record[@field:ID]"></div> <script> if ( '[@cbTimestamp*]' > '[@field:FivedaysToDate*]') { document.getElementById("record[@field:ID]").innerHTML = "<a href='http://caspio.com'>Click here to open Caspio</a>"; } </script> [@field:ID] should be replaced with field which is keeping the unique ID and also href value with the link you want to open. [@field:FivedaysToDate] is the formula field in the table. Attached is the sample page you can import to your account CaspioData_2017-Sep-20_1404.zip Quote Link to comment Share on other sites More sharing options...
DBAXTER Posted September 21, 2017 Report Share Posted September 21, 2017 First of all, thank you so much for addressing this topic! Second, I've entered this into my html block like so: <div id="record[@field:tbl_schedule_appointment_Appointment_ID]"></div> <script> if ( '[@cbTimestamp*]' > '[@field:tbl_schedule_appointment_Appointment_RescheduleLimit*]') { document.getElementById("record[@field:tbl_schedule_appointment_Appointment_ID]").innerHTML = "<a href="#" onclick="window.open("https://c0abz413.caspio.com/dp.asp?AppKey=b59950002482bd3538ce4196929d&Appointment_ID=[@field:tbl_schedule_appointment_Appointment_ID]","mywindow", "menubar=1,resizable=1,scrollbars=yes,width=630,height=610")"><img alt="" src="https://antidotecrs.com/wp-content/uploads/2017/09/rescheduleicon.jpg" style="width: 20px; height: 20px;" /></a>"; } </script> Now I'm not showing any icon when I preview the page. I have checked the formula field; it is working. Could this be because I am using an image on my calendar as the reschedule link? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.