Jump to content
  • 0

Stop Auto Submit on Details form based on Virtual field value


DesiLogi

Question

Hi,

I have some code I'm trying to get to work in the Footer on a Details form to halt AutoSubmit code when a value of 1 is reached in a Virtual field (calculated). The Details datapage is set to go to 'Next Record' on update so the Auto Submit cycles through the records. The problem is that when it gets to the last record it keeps auto submitting and I need it to stop AFTER submitting the last record. 

I found some code on this forum but can't get it to work- that code was older, before virtual fields could be calculated. If anyone knows how to adjust this code to get it to work that'd be really great. 

<script type="text/javascript">
if(document.getElementById("caspioform"))
{
if(document.getElementsByName("cbParamVirtual2")[0].value==1)
  {     
     document.getElementById("caspioform").style.visibility = 'hidden';
     document.write('<font face="arial" color=red size="5">No more Submissions!');     
  }
else
  {
 setTimeout('document.forms["caspioform"].submit()',1000);
       }
}
</script>

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I figured out a workaround. Instead of a Virtual field calculating the remaining records in the filtered recordset, and then used in If/Else for auto-submitting when all records have been updated, a filtered View is used instead for the data source. 

This enables the auto-submit to run and when there are no more records to update (because the View filters out updated records) I use the Localization to redirect to a new url when there are no records (351 message). 

So basically, all the records in the recordset get cycled through on the Details datapage (set to go to 'Next Record' after update) and then when there are no further records (because the View datasource is empty) it redirects to a new url. 

A bit of a labyrinthine process but it gets the job done. 

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