Switching Records in active form

Pat_Houstoun
Member Posts: 5
It seems to me that this task should be a simple one, but I cannot find a way to do it.
The case: I am in a form (for the sake of argument, the Purchase Order form) viewing a record (for the sake of argument, Type="order", No.=3). Within the code, I have determined that I want to be looking at No.=27 instead. What I want to do, in code, is make Purchase Header No. 27 the active record in this form, without a lookup of any kind, and without opening another instance of the form. How does one replace the active record in a form?
Any help would be appreciated...Thanks in advance...
Pat Houstoun, NCSD
President, Management Software Solutions, Inc.
The case: I am in a form (for the sake of argument, the Purchase Order form) viewing a record (for the sake of argument, Type="order", No.=3). Within the code, I have determined that I want to be looking at No.=27 instead. What I want to do, in code, is make Purchase Header No. 27 the active record in this form, without a lookup of any kind, and without opening another instance of the form. How does one replace the active record in a form?
Any help would be appreciated...Thanks in advance...
Pat Houstoun, NCSD
President, Management Software Solutions, Inc.
Pat Houstoun, NCSD
President, Management Software Solutions, Inc.
President, Management Software Solutions, Inc.
0
Comments
-
Hello Pat,
I think you are looking for the following code which will switch the active record in a form.
PurchHeader.SETRANGE("No.",??the NEW NO. ??);
If PurchHeader.FIND('-') THEN
Rec := PurchHeader;
You may have to handle the xRec, but I did not test that.
Steve Florko
NCPS,NCSD,NCDS,WSSD,WSWD
Application DevelopmentSteve0 -
I have tried virtually everything else; I thought I had tried that in several variations as well. In fact, I assume I started there.
I did put a modify and a commit before your code. Works perfectly. Many thanks.
By the way, please call me when you get a minute...
Pat Houstoun, NCSD
President, Management Software Solutions, Inc.Pat Houstoun, NCSD
President, Management Software Solutions, Inc.0 -
I can understand your problem. Even though the solution is extremely simple it took me quite a time until it worked:
simply program:
Get (type::order,'27');
Currform.update
Marcus Fabian
m.fabian@thenet.ch
+41 79 439 78 72
[This message has been edited by fabian (edited 23-09-2000).]With best regards from Switzerland
Marcus Fabian0
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