Create multiple records in blanc form

Create multiple records in blanc form

Hello,

I have a question about the insert into function.

I have three forms:

Form A: containing the fields: Name, group and Number ;
Form B: containing the field: Name, group and Number and Message;
Form C (blanco form): Containing the field Group and Message;

When I select the blanco form I have made a submit button with has to do the following action:

Based on the selected group, it has to search in Form A who is in the selected group.
It has to input the users who are in the group into form B.

I have made the following script:

  1. Meldingensubform = (Employee_s_Sales[Groups = input.Groups].ID).getall();
  2. cnt = 0;
  3. for each employee in Employee_s_Sales  [Groups = input.Groups]
  4. {
  5.     if (cnt  <  Meldingensubform.size())
  6.     {
  7.         ProductID = Meldingensubform.get(cnt);
  8.         Meld  =  Employee_s_Sales  [ID == ProductID];
  9.                               
  10.         insert into Send_Page_Sales
  11.         [
  12.                         Added_User = zoho.loginuser
  13.                         Custom_Message = input.Custom_Message
  14.                         Mobile = (Meld.Mobile)
  15.                         Quick_Message = input.Quick_Message
  16.         ]
  17.            }
  18. }
It does create the right amount of matching rules. But I doesn't fills in the right values based on the form A.

So It repeats the number and the name. How can I make sure it puts in the right amount of records with the right number and name?


Really hope to hear from someone soon.


Greatings,


Erwin