Refresh problem with SubForms

fernando_lm
Member Posts: 27
I hope you'll understand my request, my knowledge of english language is quite basic.
I've got a main form (with no SourceTable) and two SubForms (Meeting To-dos and not-Meeting To-dos).
The Subforms records are filtered using a function on the main form:
fntActualizar()
CLEAR(rstTarea);
rstTarea.SETCURRENTKEY(Date,”Starting time”);
rstTarea.SETFILTER(“Salesperson Code”,txtFiltroVendedores);
rstTarea.SETFILTER(Date,’=>%1&=<%2’,datFechaDesde,datFechaHasta);
rstTarea.SETFILTER(“System To-do Type”,’=%1|=%2’, rstTarea. “System To-do Type”::Organizer);
CurrForm.SubTareas.FORM.SETTABLEVIEW(rstTarea);
CurrForm.SubTareas.ACTIVATE:
CurrForm.SubTareas.UPDATECONTROLS:
CurrForm.UPDATE;
I've got two problems:
1) When I first open the mainform (OnOpenForm trigger) i run the function, but the filters do not apply formely. After that whenever i run the function it works fine and the subforms show the right records.
2) Even when the records update properly, I want the subforms to show the first record when ever they're filter is updated. (I've tryed this with WshShell: it works fine if i run it from a button on the subform but not if i call it from the main form)
I've got a main form (with no SourceTable) and two SubForms (Meeting To-dos and not-Meeting To-dos).
The Subforms records are filtered using a function on the main form:
fntActualizar()
CLEAR(rstTarea);
rstTarea.SETCURRENTKEY(Date,”Starting time”);
rstTarea.SETFILTER(“Salesperson Code”,txtFiltroVendedores);
rstTarea.SETFILTER(Date,’=>%1&=<%2’,datFechaDesde,datFechaHasta);
rstTarea.SETFILTER(“System To-do Type”,’=%1|=%2’, rstTarea. “System To-do Type”::Organizer);
CurrForm.SubTareas.FORM.SETTABLEVIEW(rstTarea);
CurrForm.SubTareas.ACTIVATE:
CurrForm.SubTareas.UPDATECONTROLS:
CurrForm.UPDATE;
I've got two problems:
1) When I first open the mainform (OnOpenForm trigger) i run the function, but the filters do not apply formely. After that whenever i run the function it works fine and the subforms show the right records.
2) Even when the records update properly, I want the subforms to show the first record when ever they're filter is updated. (I've tryed this with WshShell: it works fine if i run it from a button on the subform but not if i call it from the main form)
0
Comments
-
Create a function on the subform
Function UpdateForm
CurrForm.UPDATE;
Then call it from main form
CurrForm.SUbFormName.Form.UpdateFormThere are no bugs - only undocumented features.0 -
fernando_lm wrote:I hope you'll understand my request, my knowledge of english language is quite basic.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
The UpdateForm function really helped me. Now the subforms records update formerly when I open the mainform.
Yet the second point is not still working as I’d like to: When I update Meetings and Tasks Subforms, I want to show the first record on each table. To do that I execute:
CurrForm.Subform.ACTIVATE;
CurrForm.Subform.fntTakeFirst;
fntTakeFirst()
CREATE(WshShell);
WshShell.SendKeys('^{HOME}');
CLEAR(WshShell);
The point is, if I run this for both subforms, it only works for the last one I activate (and only if I do not activate any other object after that).0 -
Hi,
I had the same problem with the subforms but still did not solve it. The CURRFORM....... code should be placed in the open form or in the activate form?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