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

List of next 10 days in Dialog Box with Check Box

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

    List of next 10 days in Dialog Box with Check Box

    I need to create a dialog box with Check Boxes that lists the next 10 days - so obviously they change every day
    I then need to copy a specific record that I would be on (I have this done)for EACH date that was selected(haven't done this part yet)
    i.e. - If I chose 5 of the 10 days, I would make 5 copies of the record selected and change the date on each one to the dates chosen.
    I think the easiest way is to create these new records in a new table that I can then append into my existing table.

    I can't figure out how to populate a dialog box with a List of Dates.

    Thanks for your help

    #2
    Re: List of next 10 days in Dialog Box with Check Box

    Checkbox-Listbox? Use expression

    Code:
    DTOC(date())+crlf()+DTOC(date()+1)+crlf()+DTOC(date()+2)+crlf()+DTOC(date()+3)+crlf()+DTOC(date()+4)+crlf()+DTOC(date()+5)+crlf()+DTOC(date()+6)+crlf()+DTOC(date()+7)+crlf()+DTOC(date()+8)+crlf()+DTOC(date()+9)
    checkbox.png
    There can be only one.

    Comment


      #3
      Re: List of next 10 days in Dialog Box with Check Box

      Code:
      lst=dtoc(date())+crlf()
      for i=1 to 9
      	lst=lst+dtoc(date()+i)+crlf()
      	next
      ui_dlg_box("Dates",<<%dlg%
      {xmargin=2}
      [%m%.17,14selected^$lst];
      <OK><Cance>
      %dlg%)

      Comment


        #4
        Re: List of next 10 days in Dialog Box with Check Box

        Thanks - that worked for my list box, but now I need it to run a copy operation for each choice in that box. I Tried:
        DIM operation_name as c
        operation_name = "Temp_Copy"
        If operation_name <> "" then
        *for_each(BOLCOPY,copy.run(operation_name,query.filter)(BOLCOPY),v_DateCopy)
        End if
        But it never runs it correctly - I end up with a blank record.
        Once i get upto 10 records in my table I need to put the date from the list in a field

        Comment


          #5
          Re: List of next 10 days in Dialog Box with Check Box

          copy.run(operation_name,query.filter)(BOLCOPY)

          not sure what this is supposed to do ? multiply a copy operation times bolcopy

          or where query.filter is defined.

          Are you trying to do something like

          *for_each(BOLCOPY,copy.run(operation_name,"somedatefield = "+s_quote(ctod(BOLCOPY))),v_DateCopy)
          Last edited by Stan Mathews; 08-17-2012, 02:28 PM.
          There can be only one.

          Comment


            #6
            Re: List of next 10 days in Dialog Box with Check Box

            Thanks, got it so I have a record created for each date - now any hints on how I put my dates from the V_DateCopy into a field in each record
            Example - I picked three days, 08/19/2012,08/20/2012,08/21/2012 - so in each of the 3 records want to put one date into each record - that will then make them 3 unique records instead of 3 that are the same

            Comment


              #7
              Re: List of next 10 days in Dialog Box with Check Box

              This is just so much fun trying to guess what you are doing.

              got it so I have a record created for each date
              Putting the date in there at the same time you create the record would seem the simplest method.
              There can be only one.

              Comment


                #8
                Re: List of next 10 days in Dialog Box with Check Box

                How?? I have tried everything i can find - I get all the dates in each record - I need them seperate

                Comment


                  #9
                  Re: List of next 10 days in Dialog Box with Check Box

                  I have no clue how you are creating the records so I can't advise you on how to set one date for each.
                  There can be only one.

                  Comment


                    #10
                    Re: List of next 10 days in Dialog Box with Check Box

                    I've read this thread several times. I can't figure out what the starting point is and what the desired ending point is. Maybe some pictures would help us, Leah.
                    Mike W
                    __________________________
                    "I rebel in at least small things to express to the world that I have not completely surrendered"

                    Comment


                      #11
                      Re: List of next 10 days in Dialog Box with Check Box

                      The idea is as follows:
                      She (Leah) is at a certain record (not sure if she is on a record in a browse, or fetching in a form..doesn't matter).
                      She wants to display an xdlg with the next 10 days.
                      From the xdlg, she would choose one or more dates.
                      The record she is one has a date field.
                      She wants to make as many copies of that record as the number of dates she checked, each one of those copies will have (instead of the original date of the record she is at) will instead have the checked date.
                      So, here is a quick script:
                      Let's say the table has a date field called d_field:
                      Code:
                      lst=dtoc(date()+1)+crlf()
                      for i=2 to 10
                      	lst=lst+dtoc(date()+i)+crlf()
                      	next
                      ui_dlg_box("Dates",<<%dlg%
                      {xmargin=2}
                      [%m%.17,14selected^$$lst];
                      <OK><Cance>
                      %dlg%,<<%code%
                      if a_dlg_button="OK"
                      	cnt=w_count(selected,crlf())
                      	t=table.open("your_table")
                      		for i= 1 to cnt
                      		t.enter_begin(.t.)
                      		field_1=your_table->field_1
                      		field_2=your_table->field_1
                      		..all other fields same values...
                      		D_field=ctod(word(selected,i,crlf())
                      		t.enter_end(.t.)
                      	next
                      t.close()
                      end if
                      %code%)

                      Comment


                        #12
                        Re: List of next 10 days in Dialog Box with Check Box

                        You have the scenario correct - I am working on your script now - thanks for the help. I will let you know if it works.

                        Comment


                          #13
                          Re: List of next 10 days in Dialog Box with Check Box

                          I have tried your script and I know i am close, but not quite there yet. i am running this from a Form and trying to copy the current record they are on. I Copied into a Temp file so there is only one record, then was copying that into another file once for each date selected. It creates the new record, but doesn't put the information.
                          dim tablename as c
                          dim tablename2 as C
                          tablename = "daily_tickettempcopy"
                          tablename2= "dailey_ticketapptmp"
                          dim prompt_for_confirmation as l
                          prompt_for_confirmation = .f.
                          'check if the table exists
                          dim table_filename as c
                          dim table2_filename as c
                          table_filename = table.filename_get(tablename)
                          table2_filename = table.filename_get(tablename2)

                          if table2_filename <>"" then
                          tbl = table.open(tablename)
                          tbl.zap(.t.)
                          tbl.close()
                          tbl = table.open(tablename2)
                          tbl.zap(.t.)
                          tbl.close()
                          end if
                          'Run a saved 'Copy' operation: 'Temp_copy'.
                          query.filter = "daily_no = Var->v_recno"
                          query.order = "recno()"
                          'replace variables in the filter with their actual values
                          query.filter = convert_expression(query.filter,"VE")

                          DIM operation_name as c
                          operation_name = "Temp_Copy"
                          If operation_name <> "" then
                          copy.run_silent(operation_name,query.filter,query.order)
                          End if
                          ' Pick Dates and create new records in a Temp Table for each Date Selected from the Record Copy
                          lst=dtoc(date()+1)+crlf()
                          for i=2 to 10
                          lst=lst+dtoc(date()+i)+crlf()
                          next
                          ui_dlg_box("Dates",<<%dlg%
                          {xmargin=3}
                          [%m%.17,14selected^$$lst];
                          <OK><Cancel>
                          %dlg%,<<%code%
                          tablename=table.open("dailey_tickettempcopy")
                          if a_dlg_button="OK"
                          cnt=w_count(selected,crlf())
                          t=table.open("dailey_ticketapptmp")
                          for i= 1 to cnt
                          t.enter_begin(.t.)
                          tablename->Cust_No = daily_tickettempcopy->Cust_No
                          Date_new=ctod(word(selected,i,crlf()))
                          t.enter_end(.t.)
                          next
                          t.close()
                          end if
                          %code%)

                          Comment


                            #14
                            Re: List of next 10 days in Dialog Box with Check Box

                            I started reading your script but had to stop at the first Hello!
                            Code:
                            dim tablename as c
                            Don't do that. tablename is a system variable. Use any other name.
                            Then I stumbled at the second Hello!
                            Code:
                            'check if the table exists
                            dim table_filename as c
                            .............
                            You are not really checking if the table exist, you are getting the fields' names. I guess that's an indirect way of finding out.

                            ..and the third....
                            Code:
                             I Copied into a Temp file so there is only one record, then was copying that into another file once for each date selected.
                            I am not sure why are you making a round trip to Cambodia and back?! Gas is not cheap.
                            Why do you even have to copy the record to a temp table, and then copy it back several times by patching my script to the bottom of that original saved copy operation script?
                            it doesn't work that way. Just let's forget about that temp table. Let's pretend it never existed.
                            I can't help you there because I don't have access to that saved copy operation..
                            Please, let's forget about Cambodia..we still have Paris!

                            Comment

                            Working...
                            X