Set and get current record
 
            
                
                    Rainer                
                
                    Member Posts: 103                
            
                        
            
                    From a form I have to "save" the current record as follows:
1. I am on form A with record from table A:
· I click to open form-X with some code in.
...or
2. I am on form B with recordfrom table B:
· I click to open form-X with some code in.
...or
3. I am on form C with recordfrom table C:
· I click to open form-X with some code in.
In these 3 cases I need to know what is the current record... is it from A, B or C?
How?
                1. I am on form A with record from table A:
· I click to open form-X with some code in.
...or
2. I am on form B with recordfrom table B:
· I click to open form-X with some code in.
...or
3. I am on form C with recordfrom table C:
· I click to open form-X with some code in.
In these 3 cases I need to know what is the current record... is it from A, B or C?
How?
0                
            Comments
- 
            Is form X called from a button on forms A, B, and C?
 If yes:
 1. On Form X create a global for tables A, B and C
 2. On Form X create a global option var. Options = (A,B,C)
 3. On Form X create 3 functions (SetA, SetB, SetC). These fuctions should receive the appropriate record as a parameter and asign to the global record defined in step 1. They should also assign the appropriate value to the option var.
 4. From the button on forms A, B, and C. Declare form X as a global. Call the appropriate function and run form X. (Don't forget to clear the form variable)
 Form X can check the value of the option field to determine how it was called. And will have a copy of the record used to call it.
 Hope this helps..There are no bugs - only undocumented features.0
- 
            bbrown, thanks.
 On my Bottom F9 code, can you define how... Error "its not allowed to run the form in this mode"... or am I just stupid... (maybe) :roll:0
- 
            What is the exact error you are getting? Is it saying not to run modal?
 Can you please explain more, also functional, what you are trying to achieve? It sounds interesting but I do not completely understand the big picture. :?0
- 
            From one form (bottom) I need to call another form, and in this new opened form, I need to know from exactly which record I "came".
 I need to open same form from many other forms, same code and all.
 Example:
 From Customerform : Open new form and "look" at current customer
 From Vendorform : Open new form and "look" at current vendor
 From Itemform : Open new form and "look" at current Item
 In the old N3 was these "funtions" dbSETCURREC(customer) and dbGETCURREC(customer).
 The same is while you call a codunit forexample for booking invoice, and "send" the SalesHeader to the codeunit.
 Rainer0
- 
            Can't you just doForm.runmodal("Item card", rec);
 PS. Welcome to Navision for windows. 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
- 323 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

