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

Issue in My Set Design

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

    Issue in My Set Design

    I am having trouble passing a customer # in my database. Here is what I am doing. I have 2 sets as follows:

    #1 Customer Info -> Invoices (To view and create customers and review past invoices)

    #2 Invoices -> Customer Info (To create new invoices)

    For a little background, we use this for our service department. We store a lot of information in the Customer Info table beyond name. We have all the information on the product they purchased, serial #, etc. We are generally using a form based on set #1 looking up customers or adding them. I then have a create invoice button from that form which opens a form based on set #2. I want to be able to pass the customer # to this invoice form in set#2 and fill the customer # in the invoice table without having to look it up again. We already have that information from the previous form.

    The only way that I could get this to work was to open the set #2 field rule design and set the default value for customer # to a global variable. The variable gets filled when you push the button to create the invoice. It does work, but Alpha does not like it. When I open the field rules for the invoice table individually, I get an error message saying "Cannot use function in this context".

    Is there a way to do what I want other than the work around I found which doesn't seem to Kosher?

    #2
    Re: Issue in My Set Design

    Here's a nice example of how to pass values between forms.
    There can be only one.

    Comment


      #3
      Re: Issue in My Set Design

      Stan, Thank you. I had the right idea using the global variable. I just injected it into the table the wrong way. It also helps to know the code!!! The only problem I have is that the THIS.new_record() line in the ONINIT of the "items" table does not put the form into the enter mode like it's supposed to. You have to press the enter button. The example#1 in the link you sent does the same thing. Any suggestions or is there another way to make it go into enter mode immediately?

      Comment


        #4
        Re: Issue in My Set Design

        Chris, the OrdHdr1 form in the simple example works correctly Not necessary to press ENTER key to put form in enter mode. However, I've found that OnInit scripts occasionally cause problems (with complex forms or lengthy scripts). Timing issues seem to arise. So, rather than do the heavy lifting in the OnInit event I prefer the approach illustrated by the OrdHdr2 form in the example Stan referenced for you. The called form is loaded but not shown. Field values are set in the called form while it remains hidden. Then the called form is displayed to the user.

        Comment


          #5
          Re: Issue in My Set Design

          Tom, I misspoke when I said you need to hit the enter key, I meant you need to press the new record button. My goof. Anyways I took your advise and used example #2. It worked perfect for my 1st set. On the second set I'm getting an error when the script trys to feed the field the value:

          spa_invoice:Cust_Number.value = parentform:Cust_Number.value
          parentform:Cust_Number.value not found

          I've checked the spelling and capitalization of the Cust_Number field in the parent form 20+ times. It just won't see it for some reason. I tried going into the table structure of that field and re-typing the name as shown and still the same error. I even tried using different capitalization styles and no luck. I don't get it. It works perfect in my other set which uses the same names. Any idea????

          Comment


            #6
            Re: Issue in My Set Design

            Chris, two ideas:

            a) if your script is running from a subform, "parentform" references the subform itself. Is that what you mean, or do you need to reference the "topparent" ?

            b) is the calling form in enter or change mode when the script runs? Have you just entered a cust_number when the script runs ? i.e. before the record is saved? If so, change your script to commit the current record before it runs, and use the text property of the field object instead of it's value. i.e. parentform:Cust_number.text
            [ This assumes that your cust_number is actually character data, and not numeric. ]

            To answer your question authoritatively we need to see your script running in context. Post a model of your database here with instructions for us to follow to see the error message displayed.

            Comment


              #7
              Re: Issue in My Set Design

              To answer your question authoritatively we need to see your script running in context. Post a model of your database here with instructions for us to follow to see the error message displayed.[/QUOTE]

              Tom, the script is not running from a subform, is not being called in the enter or change mode, and cust_number is a character field. I'm using the find to get to a particular record and then pressing a button that runs the script. The general layout is a Customer form linked to an invoice header by cust_number. I have 2 identical sets for 2 different types of customers and one works and the other doesn't. It seems to me that it can't find the name Cust_Number for some reason.

              What is the easiest way for me to post my data base? Just zip the whole database? Thanks in advance for your help.

              Comment


                #8
                Re: Issue in My Set Design

                What is the easiest way for me to post my data base?
                Often that's easiest. If your database exceeds the maximum upload file size limit you will need to discard records and pack your tables. A better solution often is to copy your database to a new folder, drop the tables and sets not needed to illustrate the problem, and then obscure "real" data with dummy information, in a sufficient number of records to illustrate the problem. Then "backup" this "sanitized" copy to a zip file and upload it here.

                However you create the backup or zip file be sure to include written instructions in the zip or in your posted message telling us how to open the database and what steps to follow in order to see the issue.

                Comment


                  #9
                  Re: Issue in My Set Design

                  OK, here it is:


                  Start at the Main_menu form. If you click on pools and then click "Create Work Order" you will see that the script works perfect. Now exit out and go back to the main menu and click spas and the "Create Work Order". You will now get an error. I've spent hours trying to figure it out. I'm sure that I'm missing something simple.

                  On a side note, I copied a script from the message board called a4_keys which is in the code section. It allows you to use the F, C, & E keys mimicking A4. I tried to apply it to a form in the "On Key" event and it does not work at all. Where should this script be applied in a form?

                  Comment


                    #10
                    Re: Issue in My Set Design

                    Chris, your struggle here results from missing the important fact that each object in your layout has a name. That name often is the same name as the fieldname in your table structure... but NOT ALWAYS. In this case you chose to give your object a name that's NOT the same as the table fieldname.

                    Consider the line that's throwing your error:
                    Code:
                    spa_invoice:Cust_Number.value = parentform:[COLOR="Red"]Cust_Number[/COLOR].value
                    This line will throw the "not found" error you see whenever the object name (shown in red) cannot be found in your layout.

                    In this case even though you checked the object 20 times, you missed the important difference between:

                    Cust_Number

                    and

                    CustNumber

                    In short, your script is failing because it's asking Alpha to retrieve the value from an object it can't find because your script thinks that object is named "Cust_Number" when in fact that object is named "CustNumber"

                    Comment


                      #11
                      Re: Issue in My Set Design

                      Tom, once again thank you! I never really looked at the "object" names. I assumed everything worked off the field name. I would have never figured that out.

                      One last quick question concerning the method I am using to pass the field value. What is the purpose of the local variable on the second form that we are filling? The value is already going into the field that we want. I tried it without the variable and it seems to work fine, but is there an underlying reason for it? If I do use it, it has to be displayed on the form or I get an error saying that the variable is not found at the point that the script is trying to fill it.

                      Comment

                      Working...
                      X