Announcement

Collapse
No announcement yet.

[SOLVED] Get total from detail form (editable grid) in a field on the master form

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED] Get total from detail form (editable grid) in a field on the master form

    I have a master form with a detail editable grid on it. It has a column which contains numeric values. I would like to total these values in a field on the master form below it.

    A way to update in real time is needed so the user can see a sort of running total.

    Any help would be greatly appreciated. I've already added a custom field on the master form.

    Thanks in advance.

  • #2
    Look at documentation on macro sc_master_value().
    Best regards: - Reinhard -

    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

    Comment


    • #3
      Thank you for the reply. Im just starting out with SC.
      Can you please confirm if this code should go on the master form? So far its not working. Upon run-time Im asked to enter the global variable.
      Loads with a local variable but doesn't calculate anything.

      A little more detail of my particular case.
      The detail form has a field called debit which has to be totaled and I want to show it on the master form in a field called Total.

      Once again thank you for the reply.
      Last edited by gamer99; 11-18-2013, 02:54 PM.

      Comment


      • #4
        Hmm, wasn't able to get that to work, however this worked fine: http://www.scriptcase.net/forum/show...(Master-Total)

        Anyways thanks for the guidance.

        Comment


        • #5
          Originally posted by gamer99 View Post
          Can you please confirm if this code should go on the master form?
          No, use sc_master_value() in detail form, but the other solution is also ok.
          Best regards: - Reinhard -

          I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

          Comment


          • #6
            Ok I'll give that a try. Because now I have the problem of the Total field on the master form not updating in real time when a new entry is made on the detail form.

            Thanks for replying.

            Comment


            • #7
              Originally posted by gamer99 View Post
              Because now I have the problem of the Total field on the master form not updating in real time when a new entry is made on the detail form.
              Use sc_master_value() in the events onAfterInsert, onAfterUpdate and onAfterDelete of your detail forum if you want to refresh the master form in real time.
              Best regards: - Reinhard -

              I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

              Comment


              • #8
                Got it working. Thank you so much.

                Comment

                Working...
                X