How do I configure an Action to record the current timestamp or current user? - palantir-foundry

I'd like to allow users to edit an Object and want to record the time and by whom the edit was made. Is there a way to do this with an Action?

Current Timestamp can be part of your logic rule. Here are the steps to configure:
Generate a logic rule
Click in to the parameter you want to store current time
Select Current Timestamp from the dropdown
Note that this configuration only supports timestamps, not date types.
You can follow the same steps to add Current User to a string column, for example on a "last modified by" property.

Related

Can I add a timestamp to a Rules Object Type in Foundry?

I am trying to create a rules object that will return the current date so that we know when it is last modified. Is this possible? If so, what is the best way to include this field?
Yes, this is possible. When creating the Rules and Proposals, be sure to include fields with timestamps, such as the Last Modified Timestamp field below.
In the rules section for Action Types, which will affect either Proposals or Rules, be sure to change the timestamp field to “Current Time” rather than an input field.
If you do that, every time you submit an action type it will add the current time to the Rule or Proposal.

Auto edit MySQL data after a given time

We have a form which is stored in draft mode. That means editing any data or deleting the entire form is possible. The beginning to end process is as follows
When a person tries to submit the form for the first time, that is stored in draft. (the isDraft column is set to 0)
The user is redirected to another page where s/he can view the Form id (a generated number), name, a few other details and Edit/Delete options.
The user can click edit button to edit anything, or even delete the form.
However this will be allowed till a given date (say 15 days from the first submission date). Once that date is passed, the form can no longer be edited or deleted. In case the form isn't deleted, the isDraft column is set to 1.
Thousands of people can submit the form . So ,it is not possible to do it manually.
Our project is done using Laravel v6.2, but I want a general idea as well .
I can use a trait or ajax on the master page, but that is too risky and also, server inaccessibility can delay the process, and some users may get an advantage.
How to do it?
If there is no concrete answer, but rather only discussion , I will remove this post
Just store the date (time component depends on how accurate you want to be when you check the 15 day interval) when the form is created as draft.
When a user wants to edit it (display the edit form) or save an edit, compare the current date (and time) with the stored creation date + 15 days. If the current date is less than the creation date + 15 days, then allow the display of the edit form or save the form, otherwise display an error message.
Not sure if I understand it correctly, but I think you like to update the updated_at timestamp automatically. You can run through the Eloquent Models by create a command and just call the save Method on them.
$model->save()

SSRS: Conditional available values with additional custom input

These were the requirements given for an SSRS report:
A dropdown for quickly changing dates to preset ranges, such as
"YTD" or "Last 12 months"
The selected option in the dropdown should be stored in the database for each user, and retrieved when opening the report
The dates should be able to be edited directly despite what has been selected
The issue is that parameters don't cascade their default values without refreshing, requiring the report to be re-run to take effect and store the option, then to be refreshed to actually populate the "Default Values" for the date. This can be fixed by using "Available Values" instead, but means that the date fields will no longer be editable.
This may seem easy to some, but it stumped me for a bit. This is the solution that now works.
The parameters that need to be used are RangeOption, StartDate, EndDate, StartDateCustomInput, EndDateCustomInput
First, we need to create a table in the database to store the user's report preferences. SSRS has a built-in field for the user ID, so this can be passed to remember what the user's last "Range Option" was.
We follow this up by creating two stored procedures, one that gets the last run option for the user, and one that sets it. The SSRS username is the built-in user ID field.
The setting procedure should be put into a dataset, which will refresh and store the "Range Option" when the dropdown option is selected.
The dropdown parameter will use the getter procedure as its "Default Value". Under Advanced, make sure this is set to "Never Refresh".
To get the dates to update automatically without the need to re-run the report and refresh, we need to use "Available Values" instead. Plug in whatever expression you want to use, which references the dropdown parameter (#RangeOption) The catch is that this makes the date unable to be edited.
To make the date editable, a second date parameter needs to be created for our start and end dates. These dates will use "Default Values" that simply grab whatever is in the original start and end date parameters. Then, point all of our report items to the editable date fields (#StartDateCustomInput,#EndDateCustomInput).
Now, the dropdown alters the original date parameters, which then alter the editable date parameters, without running the report. The editable parameters can be altered first if the user wants, and the report will run with whatever is in these custom date parameters. The downside is that the original date parameters do not seem to cascade if they are hidden/internal, so you will likely need to have duplicate visible date parameters.
For some reason, the default values for the date parameters cascade in this way, but not the original approach.

How to create a Microsoft Access report with a date range

If this is not the forum to ask this question, please direct me to the correct one.
I am trying to learn Micosoft Access 2013 programming. I am trying to create a report on a form to display the table info based on a user defined range of the creation date. How would I go about doing this? Is the creation date stored automatically, available for retrieval?
No, Access does not automatically store the creation date of a record. However, you can accomplish that by adding a Date/Time field named [RecordCreated] (or whatever) to the table and setting its Default Value to Now(). That won't add a timestamp to existing records, but new records will automatically have their creation date (and time) recorded.

Detect time of last change on a Microsoft Access database table

Does anyone know of a way to detect when the last time a Microsoft Access table has been changed (inserted into or updated)? We used OLEDB via ADO COM to communicate with an access database programmatically and were looking for a way of detecting changes to specific tables. We don't need to know what those changes are, just that changes were made.
The only way to detect if data in the table has changed is to perform a query against the table.
You must add a column of type DATETIME to the table e.g. named LastUpdatedDate that indicates the last updated date/time of each row. Make it NOT NULL so that you will have to write an updated DATETIME value to that column for each INSERT or UPDATE. Also, set the column to have a default of DATE() for the current date stamp or NOW() for the current date/time stamp. Then add a Validation Rule or CHECK constraint e.g. CHECK (LastUpdatedDate = NOW()) to ensure the column is actually updated on each UPDATE and INSERT.
Finally, run a MAX(LastUpdatedDate) query and you will get what you need.
There isn't a way without "manually" writing to a column each time you access the table.
As others have indicated there is no way to track changes without coding it yourself.
There's a simple example at
ACC2000: How to Create an Audit Trail of Record Changes in a Form
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q197592
Audit Trail - Log changes at the record level at:
http://allenbrowne.com/AppAudit.html
The article addresses edits, inserts, and deletes for a form and subform.
Modules: Maintain a history of changes
http://www.mvps.org/access/modules/mdl0021.htm
The History Table routine is designed to write history records that track the changes made to fields in one or more tables.
You will need to implement a timestamp column in your table, and update the value during your data changes.