Set focus on the subform record

kvb
Member Posts: 107
Hi all.
There is a purchase order form.
There is a button with some code on it.
I need to set cursor in purchase lines subform to a definite record.
Anybody know how can i do such thing?
The only solution that i have is to use timer.
But it is very bad solution i think.
I also try to use CurrForm.PurchLines.FORM.SETRECORD
but it was not allright.
Your ideas are welcome.
There is a purchase order form.
There is a button with some code on it.
I need to set cursor in purchase lines subform to a definite record.
Anybody know how can i do such thing?
The only solution that i have is to use timer.
But it is very bad solution i think.
I also try to use CurrForm.PurchLines.FORM.SETRECORD
but it was not allright.
Your ideas are welcome.
0
Comments
-
This may work
CurrForm.Subform.ACTIVATE;
But do you also need to position the cursor to a specific record or just the subform?0 -
Add procedure in subform, which take parameter which record to select, add code to select this record and set focus on it (and update form etc.) and call this procedure from main form...0
-
kine wrote:Add procedure in subform, which take parameter which record to select, add code to select this record and set focus on it (and update form etc.) and call this procedure from main form...
I have already try to do this.
I create a procedure in subform with one parameter "pi_LineNo:Integer"
and run it from main form.
The code in procedure was simple:GET("Document Type", "Document No.", pi_LineNo);
At this procedure system(for some reason) tried to rename current record on a subform with key id:
"Document Type", "Document No.", "Line No."
to:
"Document Type", "Document No.", pi_LineNo.
There is a message: "Do you want to rename the record?"
Since i don`t want to rename record but only to set focus - such solution doesn`t suit me
Any other ideas?0 -
try
CurrForm.Update(true); //or try false GET("Document Type", "Document No.", pi_LineNo); CurrForm.Update(true); //or try false
0 -
Neat! I had the same problem ("do you want to rename...") and I only had to change "CurrForm.UPDATE" to "CurrForm.UPDATE(FALSE)" to solve it. Thanks!!0
-
It works in Sales Order for example.
But i have a Page and a SubPage whit temporary records and not worksMaybe whit temporary records is not possible do this?
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