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

Value checking in embedded browse

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

  • Value checking in embedded browse

    I have a browse on a form based on my invoice_detail table which contains three fields: Qty_ordered, Delivered, Billing_qty. I am trying to find a way to ensure that the user is unable to enter a billing_qty greater than Qty_ordered-Delivered. I have written a script for the ondepart event for Billing_qty to handle this on another form but the user would have to pop up the form each time he wants to enter a Billing_qty. I am trying to do this with a browse where all the info for all the rows is available at a glance. My problem is that although I can change the properties for the column there are no actions I can associate with the field column. I just want a ui_msg_box to pop up when the user enters the wrong quantity.

  • #2
    RE: Value checking in embedded browse

    I was trying to do something simlar the other day - don't know if it is doable. Perhaps a work-around is to place the fields on the form (you can hide them) and address the field objects instead of the browse. The fields will display (or contain - as the case me be) the current record that the browse is pointing to.
    Peter
    AlphaBase Solutions, LLC

    Peter@AlphaBaseSolutions.com
    https://www.alphabasesolutions.com


    Comment


    • #3
      RE: Value checking in embedded browse

      here's a way:
      go to the field rules for the table, and enter scripts as needed:

      following are three scripts, each for use on a different form, where the table is in an embedded browse on the form, all for the same table, of course, at the onwrotefield event:
      '******************
      'do different things for different forms
      if is_object(":batteries")
      tbl=table.get("batteries")
      tbl.amount=tbl.quantity * tbl.amt_each
      :batteries:browse1.refresh()
      :batteries:browse1.commit()
      end if
      if is_object(":tbatteries")
      tbl=table.get("batteries")
      tbl.amount=tbl.quantity * tbl.amt_each
      :tbatteries:browse1.refresh()
      :tbatteries:browse1.commit()
      :tbatteries:button2.activate()
      end if
      if is_object(":batteries3")
      tbl=table.get("batteries")
      tbl.amount=tbl.quantity * tbl.amt_each
      :batteries3:browse1.refresh()
      end if

      '***********
      and here is a script that fires at the cansaverecord event for the table:
      'set default price based on company

      if is_object(":edit batteries")
      t=table.get("batteries")
      if rtrim(var->company)="HAE"
      t.amt_each=t.hae
      elseif rtrim(var->company)="IHS"
      t.amt_each=t.ihs
      end if
      :edit_batteries:browse1.refresh()
      end if

      also, you can do a lot on the form's browse's canrowchange event

      although this code does't directly reflect your need - I think you can get the idea
      Cole Custom Programming - Terrell, Texas
      972 524 8714
      martin_w_cole@msn.com

      ____________________
      "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

      Comment


      • #4
        RE: Value checking in embedded browse

        I just stumbled on the CanRowChange event of my embedded browse and I think I've managed to get something to work:

        t=table.current()
        IF t.qty_ordered-t.delivered

        Comment


        • #5
          RE: Value checking in embedded browse

          greg, although your situation may be different, I would think the billed quantity would always be the same as the delivered quantity.
          t.billed_qty=t.delivered_qty

          just change your script:

          t=table.current() 'as stated, you are here addressing the primary table in your set, if the form is based on a set.
          t=table.current() 'top table
          t=table.current(1) 'top table
          t=table.current(2) '1st child
          if the browse is based on a child, then be sure the current() is correct


          IF t.billed > t.delivered
          ui_msg_box("Warning","Billing Quantity Too High")
          browse1:billing_qty.activate()
          cancel()
          end if
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          martin_w_cole@msn.com

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


          • #6
            RE: Value checking in embedded browse

            Thanks for being thoughtful enough to consider issues beyond the question that I posed. This is the wonderful magic of this board.
            The invoicing portion of my app makes use of a sales order set and an invoicing set. The sales order set holds the original order. In many cases the company does not hold any inventory and there are times when only partial orders can be shipped out. The company only invoices for items shipped. As items are shipped out, partial invoices are produced. That is why billed quantities can be less than delivered quantities. The user can at any time review the status of an order by refering to the sales order set. There he can see what was originally ordered and what has been delivered to date. By examining the invoice set he can see the effect of each individual billing and the quantities associated with each billing. I hope this makes sense?

            Thanks once again.

            Comment


            • #7
              RE: Value checking in embedded browse

              yes - that makes sense

              in your canrowchange script, I should have suggested,

              t=table.current(correctreferencenumberhere)
              if t.billed_qty t.delivered_qty
              ui_msg_box("Warning","message")
              cancel()
              end
              end if

              one potential issue here is the mode of the table. if they are just scrolling the browse, you will get an error message. because we are using table methods to set the tables value.

              so, add,
              t=table.current(correctreferencenumberhere)
              if t.mode_get()=0
              t.change_begin()
              end if
              if t.billed_qty t.delivered_qty
              ui_msg_box("Warning","message")
              cancel()
              end
              end if
              'i don't usually put a change_end() here because the from commits the record when the row changes

              you could also use form methods, instead of table methods -
              if browse1:qty_billed.value > browse1:qty_delivered.value

              the advantage of form methods is you don't have to worry about whether they are in a view, change, and/or enter state.

              I have spent hundreds of hours experimenting with ways to successfully control entry/change in embedded browses. And I tend to use table field rules most of the time. It seems to work better.

              But for often inexplicable reasons, one method works better in one instance than the other.

              I'll see if I can put together a small sample of my database where I tightly control the users in embedded browses.
              Cole Custom Programming - Terrell, Texas
              972 524 8714
              martin_w_cole@msn.com

              ____________________
              "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

              Comment

              Working...
              X