Updating a subform from another subform

Serval
Serval Member Posts: 51
Hi all,

I'm working on Sales Order (Form 42). I already have the standard SalesLines subform.
I have created a second subform on the sales order linked to a table Y with a primary of Order No., Line No., some other keys... As I can have several records in table Y for one Sales Line, this second subform should be updated each time a line is focused on the SalesLine subform...

Is this possible ?

Thanks in advance for any help !

Comments

  • lubost
    lubost Member Posts: 633
    Message is bad, because it is not possible, because standard subform doesn't know (and see) your new subform. The only way is to create menu item on main form to refresh your subform.
  • Blizzard
    Blizzard Member Posts: 9
    Hi,

    Isn't it possible, when you focus on a line in the sales order subform (onAfterGetRecord or OnAfterGetCurrRecord), to pass some parameters, like Line No. and Item No. to the Sales order and put them in new fields in the sales header? Maybe you can put those parameters in the subformlink property of the other subform.

    I'm just thinking out loud :)

    PS: If i'm right, there was a download to do something like that on this forum several years ago, but I think it has already been cleared.
  • lubost
    lubost Member Posts: 633
    As you can find in a lot of posts, from subform isn't main form accesible.
  • kriki
    kriki Member, Moderator Posts: 9,135
    You should use a singleinstance codeunit in which you send the information from the first subform and in the receiving subform, you need to use the TimerInterval-property and trigger to check if the values have been changed in the singleinstance codeunit. If they have, change the filter and refresh the subform.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • HalMdy
    HalMdy Member Posts: 429
    Hello Serval !

    Did you have a look at http://www.mibuso.com/forum/viewtopic.php?t=1771 , this could help you ...
  • Serval
    Serval Member Posts: 51
    Thanks Kriki for your reply !
  • Serval
    Serval Member Posts: 51
    edited 2007-02-13
    Hi Mr V.

    My friend Blizzard (SDGT) and I are thanking you a lot. That's exactelly what we need. :D
    We'll try it later on and tell you if it works.
  • HalMdy
    HalMdy Member Posts: 429
    You welkome , old friend ! Reg. to Blizzard too !
  • lubost
    lubost Member Posts: 633
    It is possible, but firing of timer causes the focus loss from active field and unpredictable errors in OnValidate triggers.
  • Serval
    Serval Member Posts: 51
    It works perfectely !
    lubost wrote:
    It is possible, but firing of timer causes the focus loss from active field and unpredictable errors in OnValidate triggers.
    No focus loss and no unpredictable errors reported...