from a subform call a function of main form

rbindinirbindini Member Posts: 27
hello,
Is possible is a subform call a function of the parent form?
For example in a form 46 (suborder of sales order) i want call a funcion of form 42 (sales order form)
Thanks

Comments

  • David_SingletonDavid_Singleton Member Posts: 5,479
    There are ways that you can "sort of" do this, but in the end its best to redefine the logic and do it differently. For example you can create a variable of the main form in the sub form, but if the function modifys records (which of course a function in a form would NEVER DO, but iff it did) then you would get versioning errors.

    Rethink the placement of the function.
    David Singleton
  • rbindinirbindini Member Posts: 27
    Hello,
    In the subform:
    1) I have add a global variable of type Form of the main form
    2) I have add a function like this:

    MCR_SetFrm(VAR frmApp : Form "Purchase Contract")
    MCR_Frm := frmApp;

    but new i compile navision lanch error:
    Assignement is not allowed for this variable

    Thanks
  • kinekine Member Posts: 12,562
    What you are doing is definitely not the NAV way... please, describe what you want to solve, why you need that. I never needed to pass Form variable into another object/function.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • rbindinirbindini Member Posts: 27
    Hello,
    I have a form with 2 subform: subform1, subform2
    When i modify record with the subform1 I want refresh data of subform2
    When i modify record with the subform2 I want refresh data of subform1
    Thanks
  • kinekine Member Posts: 12,562
    Ok, I will skip the part about possibility of upgrade of this solution... ;-)

    I recommend to read this thread: viewtopic.php?f=23&t=22564
    mainly the Garak's solutions with XMLDoc. You can use it to activate function on Master form which willl call update functions in your subforms.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.