Previous Thread

8/15/2006 12:03:20 PM    Refreshing data source on parent
Hi 
 
I'm opening a form with a menuItem. Is it possible to have a datasource on 
 
the parent form (from where I used my MenuItem) refreshed? 
 
Thanks! 
 
/Henke



8/15/2006 4:52:57 PM    Re: Refreshing data source on parent
/Henke, 
 
Try this: 
 
FormDataSource  formDataSource; 
 
; 
 
formDataSource = element.args().record().dataSource(); 
 
formDataSource.executeQuery(); 
 
Please note that the code doesn't check any objects before using them... 
 
Regards, 
 
Anton 
 
"Henke" <henke_nord*no_spam*@hotmail.com> wrote in message 
 
news:%23gSwLIFwGHA.2232@TK2MSFTNGP05.phx.gbl...

8/15/2006 5:16:18 PM    Re: Refreshing data source on parent
Hi Anton 
 
Thanks for your answer, I solved in an other strange way... 
 
On my parent form there was a method called smmRefreshDataSource or 
 
something like that. 
 
On my child form I tried to call it like this: 
 
FormRun caler; 
 
; 
 
caller = element.args().caller(); 
 
caller.smmRefreshDataSource(); 
 
which didn't work and that I understand why. There is no method calld 
 
smmRefreshDataSource on the FormRun object. But if I add a method on my 
 
child form also called smmRefreshDataSource and in this method I put the 
 
code above everything works. How is that possible? 
 
/Henke 
 
"Anton Venter" <anonymous@newsgroups.com> skrev i meddelandet 
 
news:urVdDqHwGHA.3392@TK2MSFTNGP04.phx.gbl...

8/18/2006 4:49:16 PM    Re: Refreshing data source on parent
This is kind of an Axapta workaround. You can call anything on an object of type Object. One reason 
 
for that is, that you could not call any self defined methods on a FormRun from outside the form 
 
otherwise. And that is because, there is no true inheritance for Forms, you don't create a new 
 
class, which extends from FormRun, like you would do in C# for instance. 
 
Anyway it is a common practice, to add a runtime check, to check for that method with the help of 
 
Global::formHasMethod(...). 
 
Mike