Jump to content

Increment value in one field based on status in another field


Recommended Posts

Hi, you may use the following script in the footer of the datapage:

<SCRIPT LANGUAGE="JavaScript">
 
function calculate()

{
var check = document.getElementById("InsertRecordField_name").value;

if(check =="Approved"){

var v_increment = parseFloat(document.getElementsByName("cbParamVirtual1")[0].value);


   document.getElementById("InsertRecordField2").value = v_increment+1;
 }
}

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

</SCRIPT>

You need to use a virtual field to sort values in descending order and get the last submitted value, then increment value and write in a field

Link to comment
Share on other sites

  • 11 months later...

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
Reply to this topic...

×   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...