Jump to content
  • 0

Can you block a user from updating a record based on today's date?


ClayG

Question

I have built an app in Caspio for asking people to potentially volunteer on short term assignments.

They get an email with the details, and there's a link in that email that goes to a simple data page which uses the "Find record through unique ID" to open the specific volunteer request we are asking them to respond to. It works well.

But now we want to somehow expire these requests such that if the user doesn't respond within 14 days, we want to block them from responding (Yes or No) to the volunteer request. 

I can't think of how I might put this into place?

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

In case anyone else has a similar need, here's what I came up with that seems to work okay...

In the datapage on the configure fields screen, I created a virtual field that is a calculated value. In my case, I put in a SELECT statement that retrieves the date in the record that is being (potentially) updated. My example:

Quote

select Ask_Date from Team_Appointments where Record_ID = [@field:Team_Appointments_Record_ID]

 

Next, I created another virtual field that is also a calculated value, and I use the Datediff function to see how many days there are between the current time and my other virtual field. I multiple this by "-1" to make it a positive number. 

Quote

Datediff(day,SysUTCDateTime(), [@cbParamVirtual2]) * -1

 

I then used the "Rules" feature to see if my virtual field is greater than whatever number we decide to go with (e.g., 30 days) and if it is, my actions on the Rules screen will hide different sections of the datapage.

 

Link to comment
Share on other sites

  • 0
6 hours ago, ClayG said:

But now we want to somehow expire these requests such that if the user doesn't respond within 14 days, we want to block them from responding (Yes or No) to the volunteer request. 

Probably another way to do this is with Tasks. Have something like a Yes/No 'Expired' field in the table. Have the Task run each day (or each hour) and check to see if the date difference is whatever you want. If so, set 'Expired' to true. Then, on the datapage, use Rules to hide the sections you don't want the users to see after expiration. Maybe have another section with an HTML Block note that says "This request has expired", that is hidden when 'Expired' is false and shows only when 'Expired' is true.

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...