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

auto date entry in dialog box

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

    #16
    Re: auto date entry in dialog box

    structure on the table is the field classed as a date?
    Yes in Field rules
    User entered
    Simple default expression
    DATE()
    Skip .t.

    what is the regional settings for the date on your server?
    I could not find this.
    However on the interactive tab
    I get
    date = date()
    ?date
    = {08/10/2009}
    so that seems OK.

    Comment


      #17
      Re: auto date entry in dialog box

      I found this article which seems fairly near
      http://msgboard.alphasoftware.com/al...ght=date+today Item #3

      Todays date shows in the correct field in the component but when I submit the field is not completed in the table

      Comment


        #18
        Re: auto date entry in dialog box

        Just one more point
        If I enter a line in the table the date is inserted correctly

        Comment


          #19
          Re: auto date entry in dialog box

          You need to loose the field rules. Then the Grid will work
          Chad Brown

          Comment


            #20
            Re: auto date entry in dialog box

            I seem to have tried everything but just cant get todays date to auto enter in the date field from a grid.
            I found this article in the help files but that does not work here either.

            http://support.alphasoftware.com/alp...rted_Title.htm

            Defaulting a Date Field to Today's Date.

            You would think this is very basic!
            Most strange
            Cheers
            John

            Comment


              #21
              Re: auto date entry in dialog box

              Ok lets start over if you are using v10 application the some field rules can be passed through the web take my original grid i sent you and remove the hidden field date. then remove the can insert items that i put in. Set your field rules to calculate and the calculation is Date()

              This will now let you use both web and desktop. I have tried this and it works on V10. Simple as that.
              Chad Brown

              Comment


                #22
                Re: auto date entry in dialog box

                Thanks Chad
                I am using V9
                I did start to use V10 but went back to V9 (to keep things simple)

                Comment


                  #23
                  Re: auto date entry in dialog box

                  Version 9 drop the field rules on the table then.
                  Chad Brown

                  Comment


                    #24
                    Re: auto date entry in dialog box

                    Thanks Chad
                    I wish I could say that it works, but it does not create the date on my machine.

                    Comment


                      #25
                      Re: auto date entry in dialog box

                      John,

                      I tested Chad's component, and it works perfect, so you are doing something basic wrong.

                      As said, remove all Field Rules from the table, at least for this date field. Make sure it is a DATE field, not Time or Char or something else.

                      Review Chad's component - your date field must be hidden, hide row checked AND updateable checked. Typically that means you first make the field a textbox, ensure Updatable is checked, and only then change it to Hidden and check Hide Row. (That is, if you start from it being a Label, it does not end up being Updateable.)

                      Chad used the CanInsertRecord Event which means this only works for NEW records. I personally use the BeforeValidateNewRecords for the same thing.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #26
                        Re: auto date entry in dialog box

                        Thanks Steve
                        Its very good of you to comment.
                        I have looked at the details and still cant see where I am going wrong.
                        I copied this xbasic code below I'm not sure if this may show you where I am wrong, I also attach an image of various stages.

                        dim tmpl as p
                        tmpl.ComponentName = "Testdate"
                        tmpl.ComponentType = "Grid"
                        tmpl.AjaxOn = .f.
                        tmpl.LayoutColumns = 1
                        tmpl.SecurityModel = "Group Based"
                        tmpl.SecurityMode = ""
                        tmpl.PreCalcMode = "Standard"
                        tmpl.DataSourceType = "DBF"
                        tmpl.DBF.type = "Table"
                        tmpl.DBF.table_name = "[PathAlias.ADB_Path]\testdate.dbf"
                        tmpl.DBF.primaryKey = "recno()"
                        tmpl.DBF.filter = ""
                        tmpl.DBF.order = "Recno()"
                        tmpl.DBF.flags = ""
                        tmpl.DBF.fieldmap = <<%str%
                        key_table_1,n,5,0=recno("testdate")
                        NAME,C,16,0=Name
                        TODAYSDATE,D,8,0=Todaysdate
                        %str%

                        tmpl.grid_is_editable = .t.
                        tmpl.edit.allow_update = .t.
                        tmpl.edit.allow_insert = .t.
                        tmpl.edit.number_of_insert_rows = 3
                        tmpl.edit.allow_delete = .t.
                        tmpl.ShowNewRecordsOnLastPageOnly = .f.
                        tmpl.SecurityMode = ""
                        tmpl.edit.delete_checkbox_label = "Delete"
                        tmpl.edit.has_Cancel_button = .f.
                        tmpl.edit.cancel_button_text = "Cancel"
                        tmpl.edit.submit_button_text = "Submit"
                        tmpl.edit.confirm_before_submit = .f.
                        tmpl.edit.confirm_before_submit_message = "Submit changes?"
                        tmpl.edit.check_for_write_conflicts = .t.
                        tmpl.edit.write_conflict_check_type = 2
                        tmpl.edit.save_original_values = .t.
                        tmpl.edit.Show_Update_Commands = .f.
                        tmpl.edit.Execute_Update_Commands = .t.
                        tmpl.edit.TargetPage = "<Self>"
                        DIM tmpl.update.tables[1] as P
                        tmpl.update.tables[1].name = "[PathAlias.ADB_Path]\testdate.dbf"
                        tmpl.update.tables[1].PrimaryKey = "recno()"
                        tmpl.update.tables[1].PrimaryKeyType = "N"
                        tmpl.update.tables[1].table_alias = "testdate"
                        tmpl.grid_layout_style = 1
                        tmpl.add_records_only = .f.
                        tmpl.rows = 10
                        tmpl.suppress_empty_rows = .t.
                        tmpl.has_row_separator = .t.
                        tmpl.alternate_bands = .f.
                        tmpl.even_band_size = 1
                        tmpl.odd_band_size = 1
                        tmpl.alternate_column_bands = .f.
                        tmpl.even_column_band_size = 1
                        tmpl.odd_column_band_size = 1
                        tmpl.conditionalStyle = ""
                        tmpl.show_title = .f.
                        tmpl.title = ""
                        tmpl.FontSize = "Medium"
                        tmpl.No_records_message = "No records in query"
                        tmpl.total_records_row_position = 1
                        tmpl.total_records_row = "Records:&nbsp; {Total_Records}&nbsp;"
                        tmpl.show_column_titles = 1
                        tmpl.show_row_labels = .t.
                        tmpl.sort_style = 3
                        tmpl.reset_page_number_when_sorting = .t.
                        tmpl.EditRegion.Grid.Top = <<%txt%
                        %txt%
                        tmpl.EditRegion.Grid.Bottom = <<%txt%
                        %txt%
                        tmpl.EditRegion.Grid.Left = <<%txt%
                        %txt%
                        tmpl.EditRegion.Grid.Right = <<%txt%
                        %txt%
                        tmpl.HasNewRecordsTitle = .f.
                        tmpl.NewRecordsTitle = "<tr><td class=\"{a5_style}ColumnTD\" colspan=\"{a5_colspan}\" style=\"padding: 0px;\" >New Records</td></tr>"
                        tmpl.HasExistingRecordsTitle = .f.
                        tmpl.ExistingRecordsTitle = "<tr><td class=\"{a5_style}ColumnTD\" colspan=\"{a5_colspan}\" style=\"padding: 0px;\" >Existing Records</td></tr>"
                        tmpl.row_separator = "<tr><td class=\"{a5_style}SeparatorTD\" colspan=\"{a5_colspan}\" style=\"padding: 0px;\" ></td></tr>"
                        tmpl.fields = 2
                        DIM tmpl.field_info[tmpl.fields] as P
                        with tmpl.field_info[1]
                        .Fieldname = "Name"
                        .Scope = "Local"
                        .DisplayFormat = ""
                        .DisplayUnFormat = ""
                        .Type = "C"
                        .Updateable = .t.
                        .Table_Alias = "testdate"
                        .FieldToUpdate = "Name"
                        .Varname = "NAME"
                        .NullIfBlank = .f.
                        .Column.LabelPosition = "Left"
                        .Controltype = "TextBox"
                        .Textbox.Size = 16
                        .Textbox.MaxLength = 16
                        .Textbox.InLineStyle = ""
                        .Textbox.StyleFieldIfError = .t.
                        .Textbox.ErrorInlineStyle = ""
                        .Textbox.IsPassword = .f.
                        .BreakType = "None"
                        .nCols = 1
                        .Column.Hide = .f.
                        .Column.Heading = "Name"
                        .Column.Sort = "Name"
                        end with
                        with tmpl.field_info[2]
                        .Fieldname = "Todaysdate"
                        .Scope = "Local"
                        .Type = "D"
                        .Updateable = .t.
                        .Table_Alias = "testdate"
                        .FieldToUpdate = "Todaysdate"
                        .Varname = "TODAYSDATE"
                        .NullIfBlank = .f.
                        .Column.LabelPosition = "Left"
                        .Controltype = "Hidden"
                        .BreakType = "None"
                        .nCols = 1
                        .Column.Hide = .t.
                        end with
                        tmpl.RecNav.SuppressIfOnlyOnePage = .t.
                        tmpl.RecNav.First_Label = "First"
                        tmpl.RecNav.Has_First_Button = .t.
                        tmpl.RecNav.Has_Last_Button = .t.
                        tmpl.RecNav.Has_Next_Button = .t.
                        tmpl.RecNav.Has_Prev_Button = .t.
                        tmpl.RecNav.HTML_Template_source = "Computed"
                        tmpl.RecNav.Justify = "Left"
                        tmpl.RecNav.Last_Label = "Last"
                        tmpl.RecNav.Next_Label = "Next"
                        tmpl.RecNav.Number_of_page_links = 10
                        tmpl.RecNav.Page_Numbering_Style = 3
                        tmpl.RecNav.PagesTemplate_w_PageCount = "{PageNumber} of {PageCount}"
                        tmpl.RecNav.PagesTemplate_wout_PageCount = "{PageNumber}"
                        tmpl.RecNav.Position = 1
                        tmpl.RecNav.Prev_Label = "Prev"
                        tmpl.RecNav.Show_disabled_controls = .t.
                        tmpl.RecNav.Show_Page_Count = .t.
                        tmpl.RecNav.Use_Images = .f.
                        tmpl.style_name = "TeaCup"
                        tmpl.UseSimpleStyles = .f.
                        tmpl.GUID = "448a642a-c861-44a8-8121-5d143eecf60c"
                        tmpl.EventCode = <<%code%

                        function CanInsertRecord as v (DataSubmitted as P, Args as p, PageVariables as p, Result as p)
                        with PageVariables
                        DataSubmitted.Todaysdate = date()
                        Result.Cancel = .f.
                        Result.ErrorHTML = ""
                        end with
                        end function
                        %code%
                        tmpl.ajaxOn = .f.
                        tmpl.ajaxOn = .f.

                        Comment


                          #27
                          Re: auto date entry in dialog box

                          Delete your grid and start over. You've changed the name of the table field after you created the grid, so they dont match any more. Grid updates "Todaysdate" but your table shows the field is named testdate. Make it easy, just delete the grid and create a new one following Chad's suggestions.
                          Steve Wood
                          See my profile on IADN

                          Comment


                            #28
                            Re: auto date entry in dialog box

                            Thanks so much
                            How do I apologise enough for my stupid mistake. So sorry gents.
                            Humbly

                            John

                            Comment

                            Working...
                            X