Jump to content
  • 0

How to timestamp a field


ppbb123

Question

Hi

I want to timestamp two specific fields of a record. I have a calendar table that has a place for 2 files to be uploaded in the details page (one for client prep work, the other for post meeting notes). Is there any way to record a timestamp that instead of timestamping when the record was updated? How to timestamp when one specific field is updated? I have the following fields:

File1 Update1 File2 Update2

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

The Form Elements of Update1 and Update2 should be Hidden in the Details Page. You can try this code in the Footer:

If the data type of File1 and File2 is "Text(255)", "Number", or "Date/Time" in the table design

<SCRIPT LANGUAGE="JavaScript">

function update1()
{
var File1Old = "[@field:File1]";
var File1New= document.getElementById("EditRecordFile1").value;

if (File1Old !== File1New)
document.getElementById("EditRecordUpdate1").value = "[@cbtimestamp]";
}

function update2()
{
var File2Old = "[@field:File2]";
var File2New= document.getElementById("EditRecordFile2").value;

if (File2Old !== File2New)
document.getElementById("EditRecordUpdate2").value = "[@cbtimestamp]";
}

function submit()
{
update1();
update2();
} 

document.getElementById("caspioform").onsubmit=submit;

</SCRIPT>

If the data type of File1 and File2 is "file" in the table

<SCRIPT LANGUAGE="JavaScript">

function update1()
{
var File1New= document.getElementById("EditRecordUploadfile1").value;

if (File1New)
document.getElementById("EditRecordUpdate1").value = "[@cbtimestamp]";
}

function update2()
{
var File2New= document.getElementById("EditRecordUploadfile2").value;

if (File2New)
document.getElementById("EditRecordUpdate2").value = "[@cbtimestamp]";
}

function submit()
{
update1();
update2();
} 

document.getElementById("caspioform").onsubmit=submit;

</SCRIPT>
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...