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

How avoid adding new invoice number

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

    How avoid adding new invoice number

    I am beginner to V10. I checked Alphasport example.
    -When I click on create invoice and immediately after that I click on exit even though its adding invoice number. (If user will click on by mistake create invoice and without any changes if press exit button in that case it should not add new invoice number.)

    Please guide me how can i avoid adding number?

    Waiting for reply

    Thanks
    Harshad

    #2
    Re: How avoid adding new invoice number

    I just took a quick look at Alphasports.
    In my opinion the exit button should be better labelled "Save and Exit" according to the code on the button. That is what it does.
    Use the form's "X" to exit without saving.

    To have the exit button not save, you would need to edit the xbasic code to remove the line with Commit() and then add a button to do the commit (save).

    Comment


      #3
      Re: How avoid adding new invoice number

      Is there any way to check is user updated or not? If user updated in that case we can ask question you had done changes, do you want to save ?
      Please advise me how do I check user done any change in invoice form or embedded browser or not ?

      Comment


        #4
        Re: How avoid adding new invoice number

        If the user has begun any changes the form will be in change mode.
        If yo collect the initial field values with alltext_initial(), I (on fetch event) think, you can compare that to the state of the fields at the later time.
        There can be only one.

        Comment


          #5
          Re: How avoid adding new invoice number

          I am beginner, if you can provide a small code example that will be very helpful for me.

          Thanks

          Comment


            #6
            Re: How avoid adding new invoice number

            http://wiki.alphasoftware.com/ALLTEXT_INITIAL+Function
            There can be only one.

            Comment


              #7
              Re: How avoid adding new invoice number

              In the Alphasports example because a new invoice number is generated upfront, the alltext method will always be .t.
              This type of approach though easy to implement, is not quite so simple to control issuing of numbers.
              There have been a few discussions on just this precise topic, anyone remember the last one?

              Here is an example for you to try, see how it works for your purpose.
              Code:
              if alltext() <> alltext_initial()
              	msgbox("Changes were made")
              end if
               'this will immediately be true because of the auto increment number - for illustration only. Remove the above lines once you see it.
              if mode = "ENTER" .or. mode = "CHANGE" then
              	if msgbox("SAVE","Save this invoice number?",UI_YES_NO) = 6
              	   parentform.commit()
              	   'Check to see if the record was successfully saved
              	   if parentform.mode_get()<>"VIEW" then
              	      ui_msg_box("Unable to save your changes","Please correct and save, or discard your changes", UI_STOP_SYMBOL)
              	   end if
              	else
              		cancel()
                 end if
              end if
              'Close the form
              parentform.close()
              For learning purposes. The above is the code that exists on the EXIT button with the addition of a few lines, a condition for the message box prompt and the alternative CANCEL()
              Last edited by Ray in Capetown; 12-18-2015, 06:14 AM.

              Comment


                #8
                Re: How avoid adding new invoice number

                Ray,

                This one.

                Code:
                if alltext() <> alltext_initial()
                '	msgbox("Changes were made")
                message_text_var = <<%text%
                Changed were made.
                Do you want to close without save now?
                
                OK - Close without Save records.
                Cancel - Save and Close.
                
                %text%
                end if
                'this will immediately be true because of the auto increment number - for illustration only. Remove the above lines once you see it.
                 
                msg1_result=ui_msg_box(title_var,message_text_var,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_QUESTION_SYMBOL)
                'Test to see which button on the message box was pressed....
                If msg1_result = UI_OK_SELECTED then
                	'just close it
                	sys_send_keys("{esc}")
                	'cancel()
                	parentform.Close()
                else
                	'save it	
                	parentform.Commit()
                	parentform.Close()	
                end if

                Comment


                  #9
                  Re: How avoid adding new invoice number

                  There are so many ways to do a similar thing in Alpha. If you have buttons on the form for adding a new record, allowing change to an existing one and for closing the form, and you set up the form with restrictions so that the user MUST use your buttons; then you can include all sorts of checks for the data before the expected action is taken. Otherwise if you let the user use the red X to close the form, then you need to include your data check in the CanExit event for the form.

                  BTW Stan, those alltext and alltext_initial functions are new to me and I plan on using them - Thanks!
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #10
                    Re: How avoid adding new invoice number

                    Robin.
                    Note that alltext() is essentially an SDI function and in a form based on a set, only applies to the first table record.
                    IMO you are better off sticking to the MODE methods for form control since they are in your vocabulary.

                    Comment


                      #11
                      Re: How avoid adding new invoice number

                      Thanks Ray, I will keep that in mind.
                      Robin

                      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                      Comment


                        #12
                        Re: How avoid adding new invoice number

                        Hi Ray/Stan/John/Robin,

                        Thanks a lot for sample of code that is working fine and I am happy with that.
                        One more question for Invoice form.
                        If I change in header part that is working fine and exit without saving.
                        But if I add one line in browse and in that case if I would like to cancel how can I exit without saving that line in browse?

                        Thanks in advance
                        Harshad Ganhi

                        Comment


                          #13
                          Re: How avoid adding new invoice number

                          You should maybe use a different strategy.
                          There are different ways to implement this but it involves not creating the actual numbered invoice in this set. Only preparing it. The incrementing number can be continued - only for continuity but not used.
                          At some point you will either ;
                          1. accept the invoice and copy all to the actual invoice set and allocate the next invoice number,
                          2. delete it from the preparation set or mark it rejected and discarded

                          Comment


                            #14
                            Re: How avoid adding new invoice number

                            Once the cursor leaves the browse the item is saved, so you would have to programmatically delete the record. You could add a CanExit event that prompts the user if they want to save their changes or not, and if not, delete the records in the browse. Otherwise add a a button to the form or to the browse that will delete the record manually. Or do both...

                            EDIT:
                            Oops, I see Ray beat me to it. Personally I like the Quickbooks style of doing things which seems more intuitive to me. Give the user a button or a hot key that works consistently with all the forms. Then he can add, change, save or delete records as needed.
                            Last edited by MoGrace; 01-05-2016, 12:14 PM.
                            Robin

                            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                            Comment


                              #15
                              Re: How avoid adding new invoice number

                              Thanks a lot for reply immediately.

                              For browse I will put the message by right click and delete the row, thanks for suggestion.
                              In browse after adding browse line I am able to delete without any problem so its not adding row in Invoice_Item table.
                              But its adding record on header table.

                              On exit button push event I wrote
                              sys_send_keys("{esc}")
                              cancel()
                              parentform.cancel()
                              browse1.cancel()
                              parentform.close()

                              Eventhough its adding record on header table Invoice. How to avoid that. Is this above code right ?

                              Comment

                              Working...
                              X