Refreshing data in a master-detail form

xavigepe
xavigepe Member Posts: 185
Hi. I have a master-detail form with the sales header and the sales line of a record. I want to refresh the total amounts shown in the sales header when the user changes the amount of one of the lines in the lines subform. How could I do it?.

Thanks,

Answers

  • kine
    kine Member Posts: 12,562
    Search this forum for this. There plenty of questin about "how to refresh master form (or header etc.)". Solution can be to send Ctrl+Up, Ctrl+Down keys to the application to move cursor to the header and back (activating the header).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Miklos_Hollender
    Miklos_Hollender Member Posts: 1,600
    But that's not really elegant, if somebody else needs to maintain it, he won't be happy. This is one of the problems that don't really have an elegant solution. What I usually do is to enlarge the subform, and put the sums on the subform itself, outside of the table box. These are simple decimal variables, refreshed in OnAfterGetRecord or OnAfterGetCurrRecord (I always forget which one is the better so test both).
  • xavigepe
    xavigepe Member Posts: 185
    Thanks both. I think having total fields in the subform is quite a good idea.

    Thanks