Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

partial conditional calc

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

    partial conditional calc

    Hi. I have an invoice form with the line items table having a backordered checkbox. I want the calculated filed subtotal to update each time I check or uncheck the box to exclude or include, respectively, that particular line item. Any help would be greatly appreciated.

    Frank Calandro

    #2
    Re: partial conditional calc

    You need to put the code to recalc on the OnChange Event of the checkbox field and you might need to issue a refresh() statement so the calc field updates on the screen.

    Comment


      #3
      Re: partial conditional calc

      Originally posted by Frank Calandro View Post
      Hi. I have an invoice form with the line items table having a backordered checkbox. I want the calculated filed subtotal to update each time I check or uncheck the box to exclude or include, respectively, that particular line item. Any help would be greatly appreciated.

      Frank Calandro
      You'll have to have a filtered expression for the subtotal, probably a tablesum() expression. It would look like

      tablesum("invoice_items","inv_num = "+quote(objectname1.value)+" .and. checked","extension")

      where invoice_items is the table name
      inv_num is the invoice number field name in the invoice_items table
      objectname1 is the object name of the invoice number field on the form (may have to be referenced through the browse if present)
      checked is the field name of the field in the invoice_items table that is controlled by the checkbox (logical field?)
      extension is the field name of the field in the invoice_items table to be subtotaled
      There can be only one.

      Comment


        #4
        Re: partial conditional calc

        The only problem is the field in the item table, which is ext (qnty * price), does not need to be updated in the table. It must stay visible to the customer, so they know the price they will be charged when it is shipped. The only thing I need to refresh is the subtotal on the invoice form, which is a calculated field of Total ext from invoice items. I would like to tell the calculated field to only include the ext for that line if backordered = .F. , but I do not know how to do that on a calculated field on the form. I tried posting to a subtotal field in the invoice header table, but that worked only on the condition that backordered = .F. Although I choose undo on delete, when the backordered box is unchecked, technically the item is not deleted, so it doesn't back it out. Thanks

        Comment


          #5
          Re: partial conditional calc

          Originally posted by Frank Calandro View Post
          The only problem is the field in the item table, which is ext (qnty * price), does not need to be updated in the table. It must stay visible to the customer, so they know the price they will be charged when it is shipped. The only thing I need to refresh is the subtotal on the invoice form, which is a calculated field of Total ext from invoice items. I would like to tell the calculated field to only include the ext for that line if backordered = .F. , but I do not know how to do that on a calculated field on the form. I tried posting to a subtotal field in the invoice header table, but that worked only on the condition that backordered = .F. Although I choose undo on delete, when the backordered box is unchecked, technically the item is not deleted, so it doesn't back it out. Thanks
          If you want to refer to the checkbox on the form it would be

          tablesum("invoice_items","inv_num = "+quote(objectname1.value)+" .and. "+objectname2.value,"extension")

          I think you need to attach a sample of the set and tables so we can use actual field names and demonstrate.
          There can be only one.

          Comment


            #6
            Re: partial conditional calc

            Ok, I think I attached the set and 4 tables with it. I just started building it and I have very limited skills, so bear with me. Thanks

            Frank

            Comment


              #7
              Re: partial conditional calc

              Originally posted by Frank Calandro View Post
              Ok, I think I attached the set and 4 tables with it. I just started building it and I have very limited skills, so bear with me. Thanks

              Frank
              I was able to get the filtered subtotal with

              Code:
              tablesum("nat invoice items","Invoice_Num ="+quote(invoice_num.value)+" .and. Backordered = .F.","qnty*price")
              You must click on the backordered checkbox and hit F-9 or use some alternate method to commit the record.

              I placed my subtotal just under yours.
              There can be only one.

              Comment


                #8
                Re: partial conditional calc

                Thanks so much. I shall try and see how it works. I don't mind if I have to put a button on the form "Update Total" or such. Thanks again.
                Frank

                Comment


                  #9
                  Re: partial conditional calc

                  I keep getting error... field 'invoice_num.value' not found. Also, where did the number in your field (under mine in your example) come from?

                  Comment


                    #10
                    Re: partial conditional calc

                    Originally posted by Frank Calandro View Post
                    I keep getting error... field 'invoice_num.value' not found. Also, where did the number in your field (under mine in your example) come from?
                    tablesum("nat invoice items","Invoice_Num ="+quote(invoice_num.value)+" .and. Backordered = .F.","qnty*price")
                    Should be the expression for a new calculated field. After creating the new calc field, drag-drop it on the form. That's what I placed under your subtotal.

                    The invoice_num in the portion of the expression, invoice_num.value, is the object name of the invoice_num field in the upper left corner of the form. I'll send your sample back to you tomorrow for illustration.
                    There can be only one.

                    Comment


                      #11
                      Re: partial conditional calc

                      ok.thanks

                      Comment


                        #12
                        Re: partial conditional calc

                        Originally posted by Frank Calandro View Post
                        ok.thanks

                        Unzip to a new directory. Your original zip was missing the NAT_SHIPTO_ADDY table so there are some warnings about the missing table when opening the form.
                        There can be only one.

                        Comment


                          #13
                          Re: partial conditional calc

                          Thanks for your help Stan.

                          Frank

                          Comment


                            #14
                            Re: partial conditional calc

                            Hi Stan,

                            i have tried to use your filter as per this thread, but with no luck. can you see any obvious errors?

                            id really appreciate some help

                            Code:
                            tablesum("debts","case_ref ="+quote(caseref.value)+" .and. commrepaid ="Yes"","commmonthly")
                            i have a table called 'casedetails' (parent) which has a field caseref
                            next table 'debts' (child) with a field 'case_ref' these 2 fields are the linking fields.

                            the filter field in table 'debts' is called 'commrepaid' and is a dropdown with choices yes or no.

                            the calculated field is commmonthly.

                            what i am trying to achieve is to calulate the total of all debts which are to be repaid.

                            i have examined the example you did and i believe i have duplicated it as best as i can see. but am obviously doing something wrong.

                            thanks

                            richard

                            Comment


                              #15
                              Re: partial conditional calc

                              Code:
                              tablesum("debts","case_ref ="+quote(caseref.value)+" .and. commrepaid = [B][COLOR="Red"]'[/COLOR][/B]Yes[COLOR="red"][B]'[/B][/COLOR] ","commmonthly")
                              You can't have double quotes within double quotes.
                              There can be only one.

                              Comment

                              Working...
                              X