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

conditional posting - is it possible ?

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

    conditional posting - is it possible ?

    Table: A � field: inv_no

    Table: B � 5 fields � inv1 inv2 inv3 inv4 inv5

    Is it possible to post the value of inv_no to inv1 if the value of the inv1 field is blank else post it to inv2 or post it to inv3 if inv1 & inv2 already have a value & so on.

    Value of inv_no is different for each field in table: B and it should be posted in the 1st available blank field only ONCE without touching the other fields.

    regarding the index link - that is no problem & can manage that part of the operation.

    Any help appreciated.

    Rgds,
    v.p

    #2
    RE: conditional posting - is it possible ?

    Never tried this but it should work.

    Design a saved post operation to post the inv_no to inv1. Turn on the script recorder (low level statements) and run the operation. Capture the script, edit it to name the proper tables, edit the statement which puts the value in the inv1 field, where inv1 is named as the target, substituting something like:

    case(isblank("inv1"),inv1,isblank("inv2"),inv2,isblank("inv3"),inv3,isblank("inv4"),inv4,isblank("inv5"),inv5)

    only the first true condition of the case will be executed.
    There can be only one.

    Comment


      #3
      RE: conditional posting - is it possible ?

      v.p.

      Whenever I see a table structure like Table: B in your example, that contains a series of repeating fields, all containing the same thing... an invoice number, I wonder whether the design of the data set might be improved. Often this can be achieved by putting the repeating fields in a separate table that only has two fields, a link field, and the repeating field.

      This will greatly simplify many set designs. In your present arrangement if you try to link table A and table B using the invoice number the link must include any of the possible Table: B fields. If the repeating fields were in another table and each table in that record held only a single invoice number, the link would be much more efficient.

      As a general rule (recognizing that there may be exceptions from time to time) I try hard not to overload a field by including multiple values in a single field. Your design of Table: B seems similar. The record structure in Table: B seems overloaded, since multiple values (of invoice number) are being stored in a single record.

      -- tom

      Comment


        #4
        RE: conditional posting - is it possible ?

        dear tom,
        table:B is our orders table & working fine by itself.
        when orders are shipped out we enter in in dlv1 qty1 dlv_dt1.
        hwr, in case shipped partially then in delv1 & delv2 &
        so on.

        table A: is the invoice table.. & all we trying to do is to assure that all orders shipped out are invoiced by posting the invoice no. in the inv1 field.

        please note an order may be shipped weeks apart & invoice no & invoice date are different. . hwr, generally orders are shipped 90% of the time in one lot - in this case posting is simple but few cases 2 or 4 items.

        the purpose is that if the invoice no. is posted in the orders.dbf then it has been invoiced.

        the common link between the 2 tables is the combination of orderno+product_id - example: ord456/prod123

        our general rule is - one record one product per order - while several invoices can exists for that order.
        problem is that cannot make a set as the invoice can contain
        items of other orders & other products (total 8 items can be invoiced in one invoice if the buyer is same). order/product nos. are entered with every item in the invoice.

        any ideas.

        rgds/v.p

        Comment


          #5
          RE: conditional posting - is it possible ?

          v.p.

          I'm glad it's working for you.

          I also would not do it the way you're doing it, but to each his own. To me it would be more logical (efficient?) to store the information on an order in the parent table, and link that table to one or more delivery records, each of which would receive a unique billing or invoice number. In such a design if an order takes 5, 6, or 20 shipments to complete there's no problem even if it's spread over many weeks. In your case, if you run out of invoice and delivery date fields in your child table you're stuck.

          -- tom

          Comment


            #6
            RE: conditional posting - is it possible ?

            First - ! � I agree with Tom�s comments, completely.

            Second - if you want to proceed with your original design, I wanted to see if the post could be designed.


            The following script will, I believe, demonstrate that you can do what you want. It accomplishes this by actually performing five posts, it just replaces the value in the field with �itself� if the field is not blank originally. Thus the post is performed if all �prior� fields are filled and the current field is not.


            If you are sure your data is consistent, then you could eliminate some of the multiple tests (isnotblank().and.isnotblank().and�) because it should never occur that an earlier field would be blank while a later field is not.

            a_tbl = table.open("sku")
            post.t_db = "avail_inv2.DBF"
            post.m_key = "ITM_CD"
            post.t_key = "ITM_CD"
            post.m_filter = ""
            post.t_filter = ""
            post.m_count = 5
            post.m_field1 = "Oh5"
            post.m_exp1 = "if(isnotblank(\"oh1\").and.isnotblank(\"oh2\").and.isnotblank(\"oh3\").and.isnotblank(\"oh4\").and.isblank(\"oh5\"),@Avail_Inv2->_001,Oh5)"
            post.m_field2 = "Oh4"
            post.m_exp2 = "if(isnotblank(\"oh1\").and.isnotblank(\"oh2\").and.isnotblank(\"oh3\").and.isblank(\"oh4\"),@Avail_Inv2->_001,Oh4)"
            post.m_field3 = "Oh3"
            post.m_exp3 = "if(isnotblank(\"oh1\").and.isnotblank(\"oh2\").and.isblank(\"oh3\"),@Avail_Inv2->_001,Oh3)"
            post.m_field4 = "Oh2"
            post.m_exp4 = "if(isnotblank(\"oh1\").and.isblank(\"oh2\"),@Avail_Inv2->_001,Oh2)"
            post.m_field5 = "Oh1"
            post.m_exp5 = "if(isblank(\"oh1\"),@Avail_Inv2->_001,Oh1)"
            post.t_count = 0
            a_tbl.post()
            a_tbl.close()


            As Tom indicated, what happens when all five fields are filled? This script would ignore the current inv_no, preserving current data in the master "post to" table.
            There can be only one.

            Comment

            Working...
            X