• 0
vanderLeest

Automated sequence number is child form

Question

I wonder if someone found or came across a way to add an automated sequence number (for example, in the form of the current record count) to a child form based on a one to many relationship, for example each interested person for a specific house gets a sequence number from 1 for the first entry to n for the most recent entry. For another house the sequence start again at 1.

 

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0
On 5/30/2017 at 1:58 AM, vanderLeest said:

I wonder if someone found or came across a way to add an automated sequence number (for example, in the form of the current record count) to a child form based on a one to many relationship, for example each interested person for a specific house gets a sequence number from 1 for the first entry to n for the most recent entry. For another house the sequence start again at 1.

 

 

 

As far as I understand you need to create a queue of people who wants to see the house. I suppose that you have a submission form where person can submit an inquiry. That form should receive house ID, then add a virtual field, make it to be cascading drop-down and sort values in descending order. This will let you see how many people are already in the line, then increment a value (+ 1) using java script and write into the table

The script will be like that:

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

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


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

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

</SCRIPT>

 

Share this post


Link to post
Share on other sites
  • 0

Thank you Mathilda, for your quick reply and detailed answer

Now I see there is in principle a way to do this kind of thing.

My scenario is a two child forms embedded in a main form that aims to - in one case - associate Files to an Activity and in an other case Organisations to the same activity.

I want to be able to add a (hidden) sequence number to each associated file, and each associated organisation in both a submission form and in a report detail form.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now