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

Complex conditional lookup

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

    #61
    Re: Complex conditional lookup

    G,
    contact me re: pancreas tumor. Your private is full.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

    Comment


      #62
      Re: Complex conditional lookup

      Here you go.

      Comment


        #63
        Re: Complex conditional lookup

        For the heck of it, having followed this thread, I threw together another approach with a single "products" table holding both product and service with a field "type" to distinguish the two, an xdialog presentation of the products and services for selection, and scripting the additions to the invoice table instead of a table field lookup. It's another way.
        Mike W
        __________________________
        "I rebel in at least small things to express to the world that I have not completely surrendered"

        Comment


          #64
          Re: Complex conditional lookup

          Hi Gabe,

          Thanks for posting sample. Not sure what you have done here, but there is no lookup to choose between Residential and Commercial.

          Mike, Looks like the Itm_Lookup tables in the conditional lookup have gone AWOL. Either way, it seems that you are making the Invoice Items do two lookups. Is it not possible to do one lookup by getting the Customer type directly from the customer table?
          Last edited by Keith Hubert; 04-27-2009, 04:04 PM.
          Regards
          Keith Hubert
          Alpha Guild Member
          London.
          KHDB Management Systems
          Skype = keith.hubert


          For your day-to-day Needs, you Need an Alpha Database!

          Comment


            #65
            Re: Complex conditional lookup

            Keith:
            There is no need for looking up anything. If you enter Commercial or residential and/or senior and enter the area, the correct price & senior discount will apply.

            Comment


              #66
              Re: Complex conditional lookup

              Keith,
              but there is no lookup to choose between Residential and Commercial.
              I believe that you are missing the concept that the customer type, commercial or residential, is not a specific, individual lookup or selection event. This is integral in the customer record with the field value for type, so once the customer is chosen, the customer type is set, and there is no lookup for customer type. Same for the condition of being senior.
              Either way, it seems that you are making the Invoice Items do two lookups. Is it not possible to do one lookup by getting the Customer type directly from the customer table?
              Again, it seems to me that you are mixing up apples and oranges. There are two conditions that need addressing, two selection events. 1-customer type. see above. 2-Product or Services. This is the selection event the user makes. Once the customer is selected, the customer type is set and doesn't need further address in the invoice. For the Item selection, I took the approach that there needs to be only one product table, so there in no need for 2 item tables, and so Item_lookup AND svc_lookup are combined into 1 table-products, similar to what Gabe did. Yes, the action of adding an item does generate 2 "lookups" (table.external_record_content_get() to generate the selection arrays for both product and services, but there is one user selection event. As long as the product table is not large, as I was reading that this application would not have, the array process works well.
              Mike W
              __________________________
              "I rebel in at least small things to express to the world that I have not completely surrendered"

              Comment


                #67
                Re: Complex conditional lookup

                Hi Everyone -

                Sorry to be so long in responding. Had to try and make a living today. This project is kind of a side for me.

                I will download a take a look at the updated examples.

                Thanks a lot for all your hard work.


                Mike - Based on your comments I think you have a good grasp of what I'm trying to do. Cant wait to look at what you've done.

                Thanks in advance.

                Scott

                Comment


                  #68
                  Re: Complex conditional lookup

                  Hi Mike,
                  I believe that you are missing the concept that the customer type, commercial or residential, is not a specific, individual lookup or selection event. This is integral in the customer record with the field value for type, so once the customer is chosen, the customer type is set, and there is no lookup for customer type.
                  I have clearly understood that.
                  For the Item selection, I took the approach that there needs to be only one product table, so there in no need for 2 item tables
                  But the sample you posted has two tables in the conditional lookup, both of which are missing.

                  OK, here is my take on the conditional lookup, which is what Scott asked about when he started this thread.

                  I'm not sure if there is a bug or the error message is correct. If Customer is Commercial, Lookup works. If customer is Domestic, I get error message.

                  When a customer is selected it is known what type they are (Domestic or Commercial). In my book there should not be a need to do another lookup in the Items browse to select the customer type to get the price structure.

                  Either, all the prices for Domestic and Commercial are listed in one Product table, with a field to show each price as Domestic or Commercial, this table to be filtered in the lookup by the value of customer type. Or, two tables are used with conditional lookup, again the customer type determining which table to lookup.

                  I would appreciate if you could advise why the conditional lookup is failing for Domestic customers.
                  Regards
                  Keith Hubert
                  Alpha Guild Member
                  London.
                  KHDB Management Systems
                  Skype = keith.hubert


                  For your day-to-day Needs, you Need an Alpha Database!

                  Comment


                    #69
                    Re: Complex conditional lookup

                    I don't think a conditional lookup is really needed here. Just a simple table lookup with a filter does the trick. Having 2 tables breaks some design principles, so put the Commerial and Residential records together and the table lookup on Product Id works.

                    You also needed to set type v_type variable at startup - there was another error when the form opened for the first time.

                    I don't know what was wrong with the conditional lookup... sometimes I feel that lots of messing around in this area causes problems. There didn't seem to be anything wrong, but deleting and re-entering the conditional lookups did not produce the error. But, doesn't look like a conditional lookup is required.

                    Lastly, errors were produced on the Quantity column when an item was selected. Setting a default of 1 for Quantity, to be set when a new line item is created solves that one.

                    In this database, the Commercial and Residential Products work, and the Service Area Cost works. But I'm still wondering about the Service stuff. More than one of Service will be offered? So the ServiceLookup table needs to change. Right now, when service is selected from the Products table, the Event code checks for "S" as the first letter of the Product. Then it goes and looks up the cost based on the Area. I changed the ServiceLookup table to include ResCost and CommCost.

                    Comment


                      #70
                      Re: Complex conditional lookup

                      Keith:
                      I didn'topen your zip file but do this so we could put this issue to rest:
                      1-Go to the last zip file I attached
                      2-Enter a new commercial client
                      3-In the child table add a certain product and a service
                      4-Check to see if the correct amounts were added for commercial
                      5-Add a new residential client
                      6-Add the same product and service to the residential client
                      7-again check to see that the correct amounts were added and that they are not the same as if the client was a commercial one
                      8-Add a new Senior Residential client
                      9-Add the same product and service
                      10-Check to make sure that the amount added for the service has a built-in a 5% discount.

                      The amount is calculated based on:
                      1-The Area
                      2-Whether the client is Commercial vs Residential
                      3-Whether the client is a senior or not

                      All of the above could be accomplish using a different approach wherein if you enter a commercial client you look up in a certain table while if you enter a residential client you look up in a different one. However, that is not necessary here since the prices for commercial vs residential are all included in one table. When I asked you were these values are, you pointed me to the Product table.
                      There is no need for any tables to popup except when the user is adding Products/Service. Once the user enters those, the price is calculated based on all the above factors. There is no need for the user to choose a price from a lookup table. All the user has to do is enter these different peices of information and the price is calculated by alpha.

                      Comment


                        #71
                        Re: Complex conditional lookup

                        I'm really not ignoring everyone - I swear! I've just got a moment to reply here. It is looking like I wont be able to do any more work on this til this weekend.

                        I'll look at these and get back to you all ASAP.

                        Thanks,

                        Scott

                        Comment


                          #72
                          Re: Complex conditional lookup

                          Hi David,

                          Thanks for sorting out my variable problem. I can now do the conditional lookup just the same as doing a filtered lookup.
                          Regards
                          Keith Hubert
                          Alpha Guild Member
                          London.
                          KHDB Management Systems
                          Skype = keith.hubert


                          For your day-to-day Needs, you Need an Alpha Database!

                          Comment


                            #73
                            Re: Complex conditional lookup

                            Keith,
                            Yes, you were completely correct, excuse me. The table had all those conditional lookups that were not active still there from duplicating the example table. I got rid of all those. Here is my final effort after correcting all the issues. I am one who doesn't like the practice of entering data into a browse object. This is why I take the approach of entering the data in dialogs and filtering tables and writing to the tables through scripts.
                            Mike W
                            __________________________
                            "I rebel in at least small things to express to the world that I have not completely surrendered"

                            Comment


                              #74
                              Re: Complex conditional lookup

                              Mike,

                              As always a beautiful job. There is so much to learn from your examples.
                              Regards
                              Keith Hubert
                              Alpha Guild Member
                              London.
                              KHDB Management Systems
                              Skype = keith.hubert


                              For your day-to-day Needs, you Need an Alpha Database!

                              Comment


                                #75
                                Re: Complex conditional lookup

                                Very nice Mike... I wonder if I'll ever be able to write dialogs that well... I've may start changing my approach to this stuff and using dialogs more.

                                Comment

                                Working...
                                X