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

Add new record to browse Function?

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

    Add new record to browse Function?

    Sorry to ask this again, I know there is a function to add a new record to a browse through a linking form but I cant find it.

    Please help me find this needle in the haystack.

    I recall there was a video for this from either V8 or V9.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


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

    #2
    Re: Add new record to browse Function?

    Keith
    1. Embedded browse? y/n
    2. linked by a set, ON the form?
    3. At what point do you want the new record to appear?

    Comment


      #3
      Re: Add new record to browse Function?

      Hi Ray,

      Thanks for getting back to me on this.

      The browse is a child 1:N on a form (like alphasports Invoice).

      3) After it has been saved by the accompanying form.
      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


        #4
        Re: Add new record to browse Function?

        form.ViewLinked()
        Tim Kiebert
        Eagle Creek Citrus
        A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

        Comment


          #5
          Re: Add new record to browse Function?

          Hi Tim,

          Yes, I'm sure that's the one. Many thanks for coming to the rescue. This function does not seem to be in the current documentation.
          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


            #6
            Re: Add new record to browse Function?

            It is in the original (non wiki version) of whats new in v8


            http://support.alphasoftware.com/wha...ns_and_Methods

            scroll down once the page loads for further info.
            Last edited by Tim Kiebert; 04-08-2013, 08:07 PM.
            Tim Kiebert
            Eagle Creek Citrus
            A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

            Comment


              #7
              Re: Add new record to browse Function?

              Hi Tim,

              Thanks for pointing to the location of form.viewlinked().

              This is what I'm trying to use as a test in alphasports:
              Code:
              DIM SHARED vc_inv_no AS c
              vc_inv_no = parentform:Invoice_no.value
              Dim Linkdef as c
              Linkdef = "Inv_no = vc_inv_no"
              dim p as p
              p=form.ViewLinked("Inv_Items",Linkdef)
              I'm doing something wrong as the form Inv_Items will not open. Getting error message, see attached.View_Linked_Error.PNG

              I would like the form to open as Enter New Record mode.
              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


                #8
                Re: Add new record to browse Function?

                Keith,

                My copy of Alphasports does not have a form named Inv_items.
                My copy does not have a field named inv_no in the invoice header or invoice items tables.

                If your field "inv_no" is character data, then the filter expression you've written is wrong.

                "trim(Inv_no) = " + quote(vc_inv_no)

                You'll see the difference if you test both filter expressions in the interactive window.

                Code:
                vc_inv_no = "0000101"
                my_wrong_filt  = "Inv_no = vc_inv_no"
                ?my_wrong_filt 
                = "Inv_no = vc_inv_no"
                
                my_right_filt = "trim(Inv_no) = " + quote(vc_inv_no)
                ?my_right_filt
                = trim(Inv_no) = "0000101"


                Say this over and over...

                The IW is my friend.
                The IW is my friend.
                The IW is my friend.

                I use it all the time when building filter expressions, cause I usually get them wrong, too!

                If you still have difficulty try using form.viewqueried() instead.
                Last edited by Tom Cone Jr; 04-09-2013, 06:44 AM.

                Comment


                  #9
                  Re: Add new record to browse Function?

                  Keith,

                  If you want the called form to open in ENTER mode your script will have to begin the new record for the user.

                  If I were doing this I would not bother opening linked or queried form. In pseudo code:

                  a) LOAD called form in memory, without showing it
                  b) BEGIN new record in called form
                  c) Pass link field value to (Inv_no) to the called form
                  d) Show the called form
                  e) Activate the called form
                  f) Set focus on the next field in tab order

                  Comment


                    #10
                    Re: Add new record to browse Function?

                    Hi Tom,

                    You are right, there is no form in AS called Inv_items. I created that as the new form to enter a new record into the child table instead of entering into the browse.

                    Yes I have changed the field names, sorry if that has caused confusion. I thought that was part of my problem as the field name is the same in the Invoice header and Invoice items tables.

                    I changed the code to Linkdef = "trim(Inv_no) =" + quote(vc_inv_no) but still get the same error message.

                    I know how to go down the raod you suggested but was hoping to use this function as a shortcut. Does not not so seem so short just now!!!
                    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


                      #11
                      Re: Add new record to browse Function?

                      Keith

                      From help: Alpha Five will automatically ensure that the correct values are entered into the linking fields when a record is edited or created,
                      I can open an Editable form with Form.ViewLinked() but not able to create a NEW record without additional code.


                      Code:
                      dim vInvId as c =""
                      dim vLinkFilter as c
                      vInvId = parentform:invoice_id.value
                      
                      dim vItemId as c =""
                      vItemId = parentform:browse_items.item_id.value
                      
                      'Build filter
                      'vLinkFilter = "invoice_id="+quote(vInvId)
                      vLinkFilter = "Item_id ="+quote(vItemId) 'Browse's Id
                      
                      'Open a Form or Browse layout, displaying all, or selected records in the layout.
                      dim p as p
                      p = Form.ViewLinked("ItemDialog",vLinkFilter)

                      Comment


                        #12
                        Re: Add new record to browse Function?

                        Keith,

                        See http://msgboard.alphasoftware.com/al...entry-amp-edit

                        Down load the "DialogSample" and you can find how to work with xdialog.

                        I always thanks to Peter and Mike for this examples

                        Comment


                          #13
                          Re: Add new record to browse Function?

                          Hi John,

                          This link seems to be out of date.
                          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


                            #14
                            Re: Add new record to browse Function?

                            The following works for me with some minor name changes
                            Code:
                            DIM SHARED vc_inv_no AS c
                            vc_inv_no = parentform:Invoice_no.value
                            Dim Linkdef as c
                            Linkdef = "Inv_no = " + quote(vc_inv_no)
                            dim p as p
                            p=form.ViewLinked("Inv_Items",Linkdef,"","",[COLOR="#FF0000"][B]"dialog_newrecord"[/B][/COLOR]) [COLOR="#0000FF"]'as per the documentation[/COLOR]
                            Tim Kiebert
                            Eagle Creek Citrus
                            A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                            Comment


                              #15
                              Re: Add new record to browse Function?

                              For those not familiar with this useful function, (it seems to do a good job of resynching the browse after closing the called form) here is the documentation.



                              Form.ViewLinked() Method - This new method is similar to the .ViewQueried() method in that it opens a form showing selected records. However, with the .ViewLinked() method, you can specify how the target form (i.e. the form that is opened by this method) is linked to a parent table, and Alpha Five will automatically ensure that the correct values are entered into the linking fields when a record is edited or created, ensuring that the records edited/created in the target form remain properly linked to their 'parent' record.

                              P formPointer = Form.ViewLinked (C LayoutName , C LinkDefinition [, C filter_expn [, C order_expn [, C style [, C x_position [, C y_position [, OtherOptions ]]]]]])

                              OtherOptions.Restrict_Navigation = .f.

                              Where:

                              formPointer
                              A pointer to the form that is opened.

                              LayoutName The name of the form to open. This is called the 'target' form.
                              LinkDefinition A CR-LF delimited list of link conditions in the form of:

                              linkTableField = linkValue

                              e.g.
                              firstname = "john"
                              lastname = "smith"

                              Filter_expn An optional filter to apply (in addition to the filter implied by the LinkDefinition) when the target form is opened. For example using the sample LinkDefinition shown above, the target form is automatically filtered using



                              firstname = "john" .and. lastname = "smith"

                              If you only wanted to see records for John Smith where the transaction date was in January, you might specify a filter_expn of:

                              month(transactionDate) = 1

                              Order_expn An optional order expression.

                              Style The style in which the target form should be opened. Options are: null - open as a regular modeless form, 'dialog' - open as a modal form, 'dialog_newrecord' - open as a modal form showing a new record, 'hidden' - hidden until the .show() method is called on the form pointer, 'hidden-dialog' - hidden until the .show() method is executed on form pointer (or some other method that causes the form to become visible, such as .new_record() is called). Default value is null.

                              X_Position Left, Center, Right, Fill or an absolute position expressed in pixels. Default value is null, which uses the definition stored in the form layout.
                              Y_Position Top, Center, Bottom, Fill, or an absolute position expressed in pixels. Default value is null, which uses the definition stored in the form layout.

                              OtherOptions
                              A dot variable. Currently supports a single property. OtherOptions.Restrict_Navigation. Indicates if navigation from record to record is allowed when the target form is opened. Typically, when the user is viewing the last record in a query and he/she navigates to the 'next' record, Alpha Five displays a new record. If you want to prevent the user from navigating to a new record, set this property to .t.


                              Example:

                              The following command opens the 'InvoiceItems' form and ensures that any records either edited or added are automatically linked to the correct parent record (which has an InvoiceNumber of 'INV1234'). Assume for demonstration purposes that the InvoiceNumber field in the target table (i.e. the table on which the target form is based) is called 'InvNum' (and not 'InvoiceNumber' as it might be called in the parent record).

                              dim LinkDef as c

                              LinkDef = "InvNum = \"INV1234\""

                              dim p as p

                              p = Form.ViewLinked("InvoiceItems",LinkDef)


                              PS this was new as of v8
                              Tim Kiebert
                              Eagle Creek Citrus
                              A complex system that does not work is invariably found to have evolved from a simpler system that worked just fine.

                              Comment

                              Working...
                              X