Loop Insert Record

LeoNav
Member Posts: 55
Hi, 
I need to create records based on a multiple selection. Here is my keys :
Qualification Code,Type,Code
What I need is that the system creates a list of records (that works) but for the Qualification code I have selected previously. For the moment, it creates an entire new record. So what I need is for example :
Qualification code AA25 (selected from the form 01). Afterwards, I select several lines on a form 02 and click on OK button. At this moment I need the system to create several records (loop) but for the Qualification code AA25. So how can I identify the qualification code that is used at the moment ?
Here is the code of my button (TRIGGER OnPush)
Thanks

I need to create records based on a multiple selection. Here is my keys :
Qualification Code,Type,Code
What I need is that the system creates a list of records (that works) but for the Qualification code I have selected previously. For the moment, it creates an entire new record. So what I need is for example :
Qualification code AA25 (selected from the form 01). Afterwards, I select several lines on a form 02 and click on OK button. At this moment I need the system to create several records (loop) but for the Qualification code AA25. So how can I identify the qualification code that is used at the moment ?
Here is the code of my button (TRIGGER OnPush)
Cpt:=0; CurrForm.SETSELECTIONFILTER(SelectionTest); IF SelectionTest.FINDSET THEN REPEAT Cpt:=Cpt+1; Table56204.INIT; Table56204."Qualification Code" :=; !!!! ISSUE Table56204.Type := Table56204.Type::Job; Table56204.Code := SelectionTest."No."; Table56204.INSERT; UNTIL SelectionTest.NEXT = 0;
Thanks

0
Comments
-
I'm not sure I understand what you are trying to do but I thing your problem is that you need a way to pass the selected qualification code selected in form1 to form2 where you want to use it for setting the Table56204."Qualification Code".
Create a function in form2 called fnSetQualificationCode:fnSetQualificationCode(newCode : Code(20)) qualificationCode := newCode;
Call the function from form1:form2.fnSetQualificationCode(selcetedCode);
In the loop in form2 use the global variable that was set by the function callpt:=0; CurrForm.SETSELECTIONFILTER(SelectionTest); IF SelectionTest.FINDSET THEN REPEAT Cpt:=Cpt+1; Table56204.INIT; Table56204."Qualification Code" := qualificationCode; Table56204.Type := Table56204.Type::Job; Table56204.Code := SelectionTest."No."; Table56204.INSERT; UNTIL SelectionTest.NEXT = 0;
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions