Jump to content
  • 0

Automated sequence number is child form


vanderLeest

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.

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

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

 

Link to comment
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.

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